PATCH: fix GetLocaleInfo behavior

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

That should be the right fix for bug 367 (Andreas was right ;-),
I'll post regression test later once it will be clean and adapted to
Wine ...

Mehmet

Changelog:
-  fix GetLocaleInfo behavior



diff -ur /home/mehmet/CVS/wine/ole/ole2nls.c ole/ole2nls.c
--- /home/mehmet/CVS/wine/ole/ole2nls.c	Sun Apr 28 15:42:21 2002
+++ ole/ole2nls.c	Wed May 22 13:58:27 2002
@@ -574,8 +574,9 @@
     }
     /* if len=0 return only the length, don't touch the buffer*/
     if (len) {
-	lstrcpynA(buf,retString,len);
-	return strlen(buf) + 1;
+	/* Like Windows we copy len bytes to buffer and we check len after */
+	strncpy(buf,retString,len);
+	return (len < strlen(retString) + 1)? 0 : strlen(retString)+1 ;
     }
     return strlen(retString)+1;
 }




[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux