Null-terminator fixes for SHLWAPI

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

 



1. _SHStrDupAA forgot about terminating '\0'.
2. SHStrDupA adds extra terminator which is not needed as
   the length returned by MultiByteToWideChar(,,-1,,) already includes it.

Sergei Turchanov.

--- wine/dlls/shlwapi/string.c.old 2003-01-18 00:58:46.000000000 +0000
+++ wine/dlls/shlwapi/string.c 2003-02-07 01:51:50.000000000 +0000
@@ -1716,7 +1716,7 @@
  int len = 0;
 
  if (src) {
-     len = lstrlenA(src);
+     len = lstrlenA(src) + 1;
      *dest = CoTaskMemAlloc(len);
  } else {
      *dest = NULL;
@@ -1753,7 +1753,7 @@
  int len = 0;
 
  if (src) {
-     len = (MultiByteToWideChar(0,0,src,-1,0,0) + 1)* sizeof(WCHAR);
+     len = MultiByteToWideChar(0,0,src,-1,0,0) * sizeof(WCHAR);
      *dest = CoTaskMemAlloc(len);
  } else {
      *dest = NULL;



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

  Powered by Linux