@@ -315,15 +315,13 @@ canonicalize(wchar_t *buffer, const wchar_t *path) |
|
|
315 |
315 |
'prefix' is null terminated in bounds. join() ensures |
316 |
316 |
'landmark' can not overflow prefix if too long. */ |
317 |
317 |
static int |
318 |
|
-gotlandmark(wchar_t *prefix, const wchar_t *landmark) |
|
318 |
+gotlandmark(const wchar_t *prefix, const wchar_t *landmark) |
319 |
319 |
{ |
320 |
|
-int ok; |
321 |
|
-Py_ssize_t n = wcsnlen_s(prefix, MAXPATHLEN); |
322 |
|
- |
323 |
|
-join(prefix, landmark); |
324 |
|
-ok = ismodule(prefix, FALSE); |
325 |
|
-prefix[n] = '\0'; |
326 |
|
-return ok; |
|
320 |
+wchar_t filename[MAXPATHLEN+1]; |
|
321 |
+memset(filename, 0, sizeof(filename)); |
|
322 |
+wcscpy_s(filename, Py_ARRAY_LENGTH(filename), prefix); |
|
323 |
+join(filename, landmark); |
|
324 |
+return ismodule(filename, FALSE); |
327 |
325 |
} |
328 |
326 |
|
329 |
327 |
|