Dmitry Timoshkov : kernel32/tests: Fix compilation with a PSDK compiler.
Alexandre Julliard
julliard at winehq.org
Mon Jul 8 13:50:22 CDT 2013
Module: wine
Branch: master
Commit: 0fa1877e440c695e3b44968e9fc9dc1823edd06a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0fa1877e440c695e3b44968e9fc9dc1823edd06a
Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date: Thu Jul 4 13:42:27 2013 +0900
kernel32/tests: Fix compilation with a PSDK compiler.
---
dlls/kernel32/tests/path.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/tests/path.c b/dlls/kernel32/tests/path.c
index ba47910..41650f5 100644
--- a/dlls/kernel32/tests/path.c
+++ b/dlls/kernel32/tests/path.c
@@ -21,6 +21,7 @@
#include <stdarg.h>
#include <stdio.h>
+#include <assert.h>
#include "wine/test.h"
#include "windef.h"
#include "winbase.h"
@@ -558,9 +559,10 @@ static void test_ShortPathCase(const char *tmpdir, const char *dirname,
{
char buf[MAX_PATH], shortbuf[MAX_PATH];
HANDLE hndl;
- int i;
+ size_t i;
- snprintf(buf,sizeof(buf),"%s\\%s\\%s",tmpdir,dirname,filename);
+ assert(strlen(tmpdir) + strlen(dirname) + strlen(filename) + 2 < sizeof(buf));
+ sprintf(buf,"%s\\%s\\%s",tmpdir,dirname,filename);
GetShortPathNameA(buf,shortbuf,sizeof(shortbuf));
hndl = CreateFileA(shortbuf,GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL);
ok(hndl!=INVALID_HANDLE_VALUE,"CreateFileA failed (%d)\n",GetLastError());
More information about the wine-cvs
mailing list