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 | 55c0c85f4de322ab0dff777dbf2b4a2c09a96886 (patch) | |
tree | 3c6b8f08a8cb07c486faf47840b7bc053a7047b0 /source3/lib | |
parent | 019d80f59797257aee0b979925a243da177c8dcb (diff) | |
download | samba-55c0c85f4de322ab0dff777dbf2b4a2c09a96886.tar.gz samba-55c0c85f4de322ab0dff777dbf2b4a2c09a96886.tar.bz2 samba-55c0c85f4de322ab0dff777dbf2b4a2c09a96886.zip |
allow safe_strcpy() to pass 0 for max length of string, resulting in no
effect.
(This used to be commit 47e54d049a4de3c2154b1e5edc3234b88bcc065f)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util_str.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c index 142f0af4c8..4c6a993777 100644 --- a/source3/lib/util_str.c +++ b/source3/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; |