Back to index

lightning-sunbird  0.9+nobinonly
Functions
strcpy.c File Reference
#include "plstr.h"
#include <string.h>

Go to the source code of this file.

Functions

 PL_strcpy (char *dest, const char *src)
 PL_strncpy (char *dest, const char *src, PRUint32 max)
 PL_strncpyz (char *dest, const char *src, PRUint32 max)

Function Documentation

PL_strcpy ( char *  dest,
const char *  src 
)

Definition at line 42 of file strcpy.c.

{
    if( ((char *)0 == dest) || ((const char *)0 == src) ) return (char *)0;

    return strcpy(dest, src);
}
PL_strncpy ( char *  dest,
const char *  src,
PRUint32  max 
)

Definition at line 50 of file strcpy.c.

{
    char *rv;
    
    if( (char *)0 == dest ) return (char *)0;
    if( (const char *)0 == src ) return (char *)0;

    for( rv = dest; max && ((*dest = *src) != 0); dest++, src++, max-- )
        ;

#ifdef JLRU
    /* XXX I (wtc) think the -- and ++ operators should be postfix. */
    while( --max )
        *++dest = '\0';
#endif /* JLRU */

    return rv;
}

Here is the caller graph for this function:

PL_strncpyz ( char *  dest,
const char *  src,
PRUint32  max 
)

Definition at line 70 of file strcpy.c.

{
    char *rv;
    
    if( (char *)0 == dest ) return (char *)0;
    if( (const char *)0 == src ) return (char *)0;
    if( 0 == max ) return (char *)0;

    for( rv = dest, max--; max && ((*dest = *src) != 0); dest++, src++, max-- )
        ;

    *dest = '\0';

    return rv;
}

Here is the caller graph for this function: