diff options
Diffstat (limited to 'source/lib/util_str.c')
-rw-r--r-- | source/lib/util_str.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/lib/util_str.c b/source/lib/util_str.c index ed9ea9cb2be..918d6174e7f 100644 --- a/source/lib/util_str.c +++ b/source/lib/util_str.c @@ -739,6 +739,11 @@ Return True if a string consists only of one particular character. BOOL str_is_all(const char *s,char c) { + if(s == NULL) + return False; + if(!*s) + return False; + #if !defined(KANJI_WIN95_COMPATIBILITY) /* * For completeness we should put in equivalent code for code pages @@ -786,6 +791,7 @@ BOOL str_is_all(const char *s,char c) safe string copy into a known length string. maxlength does not include the terminating zero. ********************************************************************/ + char *safe_strcpy(char *dest,const char *src, size_t maxlength) { size_t len; @@ -817,6 +823,7 @@ char *safe_strcpy(char *dest,const char *src, size_t maxlength) safe string cat into a string. maxlength does not include the terminating zero. ********************************************************************/ + char *safe_strcat(char *dest, const char *src, size_t maxlength) { size_t src_len, dest_len; |