Ignore:
Timestamp:
Jan 19, 2002, 11:50:39 AM (24 years ago)
Author:
umoeller
Message:

Misc changes.

File:
1 edited

Legend:

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

    r127 r132  
    347347 *@@ strhncpy0:
    348348 *      like strncpy, but always appends a 0 character.
     349 *
     350 *@@changed V0.9.16 (2002-01-09) [umoeller]: fixed crash on null pszSource
    349351 */
    350352
     
    354356{
    355357    ULONG ul = 0;
    356     PSZ pTarget = pszTarget,
    357         pSource = (PSZ)pszSource;
    358 
    359     for (ul = 0; ul < cbSource; ul++)
    360         if (*pSource)
    361             *pTarget++ = *pSource++;
    362         else
    363             break;
     358    PSZ     pTarget = pszTarget,
     359            pSource;
     360
     361    if (pSource = (PSZ)pszSource)       // V0.9.16 (2002-01-09) [umoeller]
     362    {
     363        for (ul = 0; ul < cbSource; ul++)
     364            if (*pSource)
     365                *pTarget++ = *pSource++;
     366            else
     367                break;
     368    }
     369
    364370    *pTarget = 0;
    365371
     
    529535    if (pszBuf)
    530536    {
    531         PSZ pOpen = strchr(pszBuf, cOpen);
    532         if (pOpen)
     537        PSZ pOpen;
     538        if (pOpen = strchr(pszBuf, cOpen))
    533539        {
    534540            // opening char found:
Note: See TracChangeset for help on using the changeset viewer.