# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1319427864 0 # Node ID 575663435272a55a19e53ff7bdfcbb6aca0e55eb # Parent 7809be48de7dafe5f46821e7c40ce0a254e19a02 Fixed not accounting for the NULL terminator on Windows when converting to wide characters. Also fixed not initializing a variable with the new code. diff -r 7809be48de7d -r 575663435272 win/dw.c --- a/win/dw.c Mon Oct 24 03:10:27 2011 +0000 +++ b/win/dw.c Mon Oct 24 03:44:24 2011 +0000 @@ -402,7 +402,7 @@ if ( access( file, 04 ) == 0 ) { /* Convert to wide format */ - MultiByteToWideChar(CP_ACP, 0, file, strlen(file), wfile, wclen); + MultiByteToWideChar(CP_ACP, 0, file, strlen(file)+1, wfile, wclen); if(!GdipCreateBitmapFromFile(wfile, &image)) return image; } @@ -5835,7 +5835,7 @@ { HBITMAP hbitmap; HBITMAP oldbitmap = (HBITMAP)SendMessage(handle, STM_GETIMAGE, IMAGE_BITMAP, 0); - HICON icon; + HICON icon = 0; HICON oldicon = (HICON)SendMessage(handle, STM_GETIMAGE, IMAGE_ICON, 0); if(id)