diff src/windows/native/sun/windows/awt_Win32GraphicsEnv.cpp @ 2859:c595c2730226

6989721: awt native code compiler warnings Reviewed-by: yan, uta
author art
date Thu, 14 Oct 2010 14:07:50 +0400
parents 00cd9dc3c2b5
children a06412e13bf7
line wrap: on
line diff
--- a/src/windows/native/sun/windows/awt_Win32GraphicsEnv.cpp	Wed Oct 13 17:03:13 2010 +0400
+++ b/src/windows/native/sun/windows/awt_Win32GraphicsEnv.cpp	Thu Oct 14 14:07:50 2010 +0400
@@ -269,7 +269,7 @@
         //if the fontPath includes %SystemRoot%
         LPWSTR systemRoot = _wgetenv(L"SystemRoot");
         if (systemRoot != NULL
-            && swprintf(tmpPath, L"%s%s", systemRoot, fontPath + 12) != -1) {
+            && swprintf(tmpPath, MAX_PATH, L"%s%s", systemRoot, fontPath + 12) != -1) {
             fontPath = tmpPath;
         }
         else {
@@ -279,7 +279,7 @@
         //else to see if it only inludes "EUDC.TTE"
         WCHAR systemRoot[MAX_PATH + 1];
         if (GetWindowsDirectory(systemRoot, MAX_PATH + 1) != 0) {
-            swprintf(tmpPath, L"%s\\FONTS\\EUDC.TTE", systemRoot);
+            swprintf(tmpPath, MAX_PATH, L"%s\\FONTS\\EUDC.TTE", systemRoot);
             fontPath = tmpPath;
         }
         else {