diff options
author | Luke Leighton <lkcl@samba.org> | 1999-07-08 18:57:58 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1999-07-08 18:57:58 +0000 |
commit | 47e54d049a4de3c2154b1e5edc3234b88bcc065f (patch) | |
tree | 8ff8b549e9efede80800f672beeadb3ff507bd82 /source/lib/util_str.c | |
parent | 389c17a225884b39d097dc0851a794d3669fdc31 (diff) | |
download | samba-47e54d049a4de3c2154b1e5edc3234b88bcc065f.tar.gz samba-47e54d049a4de3c2154b1e5edc3234b88bcc065f.tar.xz samba-47e54d049a4de3c2154b1e5edc3234b88bcc065f.zip |
allow safe_strcpy() to pass 0 for max length of string, resulting in no
effect.
Diffstat (limited to 'source/lib/util_str.c')
-rw-r--r-- | source/lib/util_str.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/lib/util_str.c b/source/lib/util_str.c index 142f0af4c87..4c6a9937778 100644 --- a/source/lib/util_str.c +++ b/source/lib/util_str.c @@ -743,6 +743,11 @@ char *safe_strcpy(char *dest,const char *src, size_t maxlength) { size_t len; + if (maxlength == 0) + { + return dest; + } + if (!dest) { DEBUG(0,("ERROR: NULL dest in safe_strcpy\n")); return NULL; |