Ignore:
Timestamp:
Apr 17, 2002, 10:11:38 PM (23 years ago)
Author:
umoeller
Message:

Patches from Martin and Paul, plus regexp support.

File:
1 edited

Legend:

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

    r153 r155  
    8989 *
    9090 *@@changed V0.9.12 (2001-05-12) [umoeller]: changed prototypes to return APIRET now
     91 *@@changed V0.9.19 (2002-04-11) [pr]: Fixed app. with no keys
    9192 */
    9293
     
    100101
    101102    // get size of keys list for pszApp
    102     if (    (!PrfQueryProfileSize(hIni, (PSZ)pcszApp, NULL, &ulSizeOfKeysList))
    103          || (ulSizeOfKeysList == 0)
    104        )
     103    if (!PrfQueryProfileSize(hIni, (PSZ)pcszApp, NULL, &ulSizeOfKeysList))
    105104        arc = PRFERR_KEYSLIST;
    106105    else
    107106    {
    108         pKeys = (PSZ)malloc(ulSizeOfKeysList);
    109         if (!pKeys)
     107        if (ulSizeOfKeysList == 0)
     108            ulSizeOfKeysList = 1;    // V0.9.19 (2002-04-11) [pr]
     109
     110        if (!(pKeys = (PSZ)malloc(ulSizeOfKeysList)))
    110111            arc = ERROR_NOT_ENOUGH_MEMORY;
    111112        else
     113        {
     114            *pKeys = 0;
    112115            if (!PrfQueryProfileData(hIni, (PSZ)pcszApp, NULL, pKeys, &ulSizeOfKeysList))
    113116                arc = PRFERR_KEYSLIST;
     117        }
    114118    }
    115119
Note: See TracChangeset for help on using the changeset viewer.