]> git.saurik.com Git - wxWidgets.git/commitdiff
OS/2 resource storage and retrieval
authorDavid Webster <Dave.Webster@bhmi.com>
Tue, 9 Nov 1999 05:57:19 +0000 (05:57 +0000)
committerDavid Webster <Dave.Webster@bhmi.com>
Tue, 9 Nov 1999 05:57:19 +0000 (05:57 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4451 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/os2/utils.cpp

index 2bae71d97b58f55aba721de4f0990cba91b54144..c82dfc9a5ae1f9d78b23da1fa8e55b8052944698 100644 (file)
@@ -418,7 +418,8 @@ bool wxGetResource(
 {
     HAB                             hab;
     HINI                            hIni;
-    static const wxChar             zDefunkt[] = _T("$$default");
+    wxChar                          zDefunkt[] = _T("$$default");
+    char                            zBuf[1000];
 
     if (rFile != "")
     {
@@ -429,11 +430,14 @@ bool wxGetResource(
                                               ,(PSZ)WXSTRINGCAST rSection
                                               ,(PSZ)WXSTRINGCAST rEntry
                                               ,(PSZ)zDefunkt
-                                              ,(void*)*ppValue
+                                              ,(PVOID)zBuf
                                               ,1000
                                              );
-            if (n != 0L || wxStrcmp(*ppValue, zDefunkt) == 0)
+            if (zBuf == NULL)
                 return FALSE;
+            if (n == 0L || wxStrcmp(zBuf, zDefunkt) == 0)
+                return FALSE;
+            zBuf[n-1] = '\0';
         }
         else
             return FALSE;
@@ -444,12 +448,16 @@ bool wxGetResource(
                                           ,(PSZ)WXSTRINGCAST rSection
                                           ,(PSZ)WXSTRINGCAST rEntry
                                           ,(PSZ)zDefunkt
-                                          ,(void*)*ppValue
+                                          ,(PVOID)zBuf
                                           ,1000
                                          );
-        if (n != 0L || wxStrcmp(*ppValue, zDefunkt) == 0)
+        if (zBuf == NULL)
+            return FALSE;
+        if (n == 0L || wxStrcmp(zBuf, zDefunkt) == 0)
             return FALSE;
+        zBuf[n-1] = '\0';
     }
+    strcpy((char*)*ppValue, zBuf);
     return TRUE;
 }