IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 21, 2006, 1:44:37 PM (20 years ago)
Author:
magnier
Message:

adding patch from josh

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_rel9_b1/psLib/src/sys/psString.c

    r6025 r6132  
    1212 *  @author Eric Van Alst, MHPCC
    1313 *
    14  *  @version $Revision: 1.21.6.1 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2006-01-17 09:23:21 $
     14 *  @version $Revision: 1.21.6.2 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2006-01-21 23:44:37 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3232    // Copy input string to memory just allocated
    3333    // Return the copy
    34     return strcpy(psAlloc(strlen(string) + 1), string);
     34    // Pass through NULL values
     35    return string ? strcpy(psAlloc(strlen(string) + 1), string) : NULL;
    3536}
    3637
     
    5051    // Copy input string to memory allocated up to nChar characters
    5152    // Return the copy
    52     returnValue = strncpy(psAlloc((size_t) nChar + 1), string, (size_t) nChar);
     53    // Pass through NULL values
     54    returnValue =
     55              string ? strncpy(psAlloc((size_t) nChar + 1), string, (size_t) nChar)
     56              : NULL;
    5357
    5458    // Ensure the last byte is NULL character
Note: See TracChangeset for help on using the changeset viewer.