Ignore:
Timestamp:
Jan 9, 2002, 10:17:41 PM (24 years ago)
Author:
umoeller
Message:

Coupla fixes.

File:
1 edited

Legend:

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

    r129 r131  
    6262 *
    6363 ********************************************************************/
     64
     65/*
     66 *@@ appQueryEnvironmentLen:
     67 *      returns the total length of the passed in environment
     68 *      string buffer, including the terminating two null bytes.
     69 *
     70 *@@added V0.9.16 (2002-01-09) [umoeller]
     71 */
     72
     73ULONG appQueryEnvironmentLen(PCSZ pcszEnvironment)
     74{
     75    ULONG   cbEnvironment = 0;
     76    if (pcszEnvironment)
     77    {
     78        PCSZ    pVarThis = pcszEnvironment;
     79        // go thru the environment strings; last one has two null bytes
     80        while (*pVarThis)
     81        {
     82            ULONG ulLenThis = strlen(pVarThis) + 1;
     83            cbEnvironment += ulLenThis;
     84            pVarThis += ulLenThis;
     85        }
     86
     87        cbEnvironment++;        // last null byte
     88    }
     89
     90    return (cbEnvironment);
     91}
    6492
    6593/*
Note: See TracChangeset for help on using the changeset viewer.