Ignore:
Timestamp:
Jul 28, 2002, 11:48:47 AM (23 years ago)
Author:
umoeller
Message:

Misc fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/prfh.c

    r167 r194  
    189189 */
    190190
    191 PSZ (prfhQueryProfileData)(HINI hIni,      // in: INI handle (can be HINI_USER or HINI_SYSTEM)
    192                          const char *pcszApp,     // in: application to query
    193                          const char *pcszKey,     // in: key to query
    194                          PULONG pcbBuf)  // out: size of the returned buffer; ptr can be NULL
     191PSZ (prfhQueryProfileData)(HINI hIni,           // in: INI handle (can be HINI_USER or HINI_SYSTEM)
     192                         const char *pcszApp,   // in: application to query
     193                         const char *pcszKey,   // in: key to query
     194                         PULONG pcbBuf)         // out: size of the returned buffer; ptr can be NULL
    195195{
    196196    PSZ     pData = NULL;
    197     ULONG   ulSizeOfData = 0;
     197    ULONG   ulSizeOfData;
    198198
    199199    // get size of data for pszApp/pszKey
    200     if (PrfQueryProfileSize(hIni, (PSZ)pcszApp, (PSZ)pcszKey, &ulSizeOfData))
    201     {
    202         if (ulSizeOfData)
    203         {
    204             pData = (PSZ)malloc(ulSizeOfData);
    205             if (!PrfQueryProfileData(hIni, (PSZ)pcszApp, (PSZ)pcszKey, pData, &ulSizeOfData))
    206             {
    207                 free(pData);
    208                 pData = NULL;
    209             }
     200    if (    (PrfQueryProfileSize(hIni, (PSZ)pcszApp, (PSZ)pcszKey, &ulSizeOfData))
     201         && (ulSizeOfData)
     202         && (pData = (PSZ)malloc(ulSizeOfData))
     203       )
     204    {
     205        if (!PrfQueryProfileData(hIni, (PSZ)pcszApp, (PSZ)pcszKey, pData, &ulSizeOfData))
     206        {
     207            free(pData);
     208            pData = NULL;
    210209        }
    211210    }
Note: See TracChangeset for help on using the changeset viewer.