comparison 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
comparison
equal deleted inserted replaced
6:7fe5da8919f7 7:71db33c0f07a
267 fontPath[fontPathLen] = L'\0'; 267 fontPath[fontPathLen] = L'\0';
268 if (wcsstr(fontPath, L"%SystemRoot%")) { 268 if (wcsstr(fontPath, L"%SystemRoot%")) {
269 //if the fontPath includes %SystemRoot% 269 //if the fontPath includes %SystemRoot%
270 LPWSTR systemRoot = _wgetenv(L"SystemRoot"); 270 LPWSTR systemRoot = _wgetenv(L"SystemRoot");
271 if (systemRoot != NULL 271 if (systemRoot != NULL
272 && swprintf(tmpPath, L"%s%s", systemRoot, fontPath + 12) != -1) { 272 && swprintf(tmpPath, MAX_PATH, L"%s%s", systemRoot, fontPath + 12) != -1) {
273 fontPath = tmpPath; 273 fontPath = tmpPath;
274 } 274 }
275 else { 275 else {
276 return NULL; 276 return NULL;
277 } 277 }
278 } else if (wcscmp(fontPath, L"EUDC.TTE") == 0) { 278 } else if (wcscmp(fontPath, L"EUDC.TTE") == 0) {
279 //else to see if it only inludes "EUDC.TTE" 279 //else to see if it only inludes "EUDC.TTE"
280 WCHAR systemRoot[MAX_PATH + 1]; 280 WCHAR systemRoot[MAX_PATH + 1];
281 if (GetWindowsDirectory(systemRoot, MAX_PATH + 1) != 0) { 281 if (GetWindowsDirectory(systemRoot, MAX_PATH + 1) != 0) {
282 swprintf(tmpPath, L"%s\\FONTS\\EUDC.TTE", systemRoot); 282 swprintf(tmpPath, MAX_PATH, L"%s\\FONTS\\EUDC.TTE", systemRoot);
283 fontPath = tmpPath; 283 fontPath = tmpPath;
284 } 284 }
285 else { 285 else {
286 return NULL; 286 return NULL;
287 } 287 }