Fixed dynamic loading on Windows CE
authorSam Lantinga <slouken@libsdl.org>
Thu, 07 May 2009 12:04:53 +0000
changeset 3119 f78ed7625325
parent 3118 5ba12c32ac6a
child 3120 1282a042d530
Fixed dynamic loading on Windows CE
src/loadso/win32/SDL_sysloadso.c
--- a/src/loadso/win32/SDL_sysloadso.c	Wed May 06 09:46:55 2009 +0000
+++ b/src/loadso/win32/SDL_sysloadso.c	Thu May 07 12:04:53 2009 +0000
@@ -96,7 +96,7 @@
     wchar_t *name_t = SDL_malloc((length + 1) * sizeof(wchar_t));
     wchar_t *errbuf_t = SDL_malloc(512 * sizeof(wchar_t));
 
-    MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, name, -1, name_t, length);
+    MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, name, -1, name_t, length + 1);
 
     symbol = (void *) GetProcAddress((HMODULE) handle, name_t);
     if (symbol == NULL) {