diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-01-02 21:01:38 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-01-02 21:01:38 +0100 |
commit | f7d30133221896638f7bf4f66c504255c4b14f48 (patch) | |
tree | 5f3e07a049f388a3a309a615b8884318f6668a98 /nsprpub/lib/libc/src/strcpy.c | |
parent | 26b297510a11758727438df4669357a2a2bc42ce (diff) | |
download | UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.gz UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.lz UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.xz UXP-f7d30133221896638f7bf4f66c504255c4b14f48.zip |
Issue #1338 - Part 1: Update NSPR to 4.24
Diffstat (limited to 'nsprpub/lib/libc/src/strcpy.c')
-rw-r--r-- | nsprpub/lib/libc/src/strcpy.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/nsprpub/lib/libc/src/strcpy.c b/nsprpub/lib/libc/src/strcpy.c index 9d319aa11..f49b3e75e 100644 --- a/nsprpub/lib/libc/src/strcpy.c +++ b/nsprpub/lib/libc/src/strcpy.c @@ -9,7 +9,9 @@ PR_IMPLEMENT(char *) PL_strcpy(char *dest, const char *src) { - if( ((char *)0 == dest) || ((const char *)0 == src) ) return (char *)0; + if( ((char *)0 == dest) || ((const char *)0 == src) ) { + return (char *)0; + } return strcpy(dest, src); } @@ -18,17 +20,22 @@ PR_IMPLEMENT(char *) PL_strncpy(char *dest, const char *src, PRUint32 max) { char *rv; - - if( (char *)0 == dest ) return (char *)0; - if( (const char *)0 == src ) return (char *)0; + + 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 ) + while( --max ) { *++dest = '\0'; + } #endif /* JLRU */ return rv; @@ -38,10 +45,16 @@ PR_IMPLEMENT(char *) PL_strncpyz(char *dest, const char *src, PRUint32 max) { char *rv; - - if( (char *)0 == dest ) return (char *)0; - if( (const char *)0 == src ) return (char *)0; - if( 0 == max ) return (char *)0; + + 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-- ) ; |