--- a/win32/GUIWin.cxx
+++ b/win32/GUIWin.cxx
@@ -163,9 +163,9 @@
 	return std::string(&vc[0], narrowLen);
 }
 
-gui_string StringFromInteger(int i) {
+gui_string StringFromInteger(long i) {
 	char number[32];
-	sprintf(number, "%0d", i);
+	sprintf(number, "%0ld", i);
 	gui_char gnumber[32];
 	size_t n=0;
 	while (number[n]) {