From 55c0c85f4de322ab0dff777dbf2b4a2c09a96886 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 8 Jul 1999 18:57:58 +0000 Subject: allow safe_strcpy() to pass 0 for max length of string, resulting in no effect. (This used to be commit 47e54d049a4de3c2154b1e5edc3234b88bcc065f) --- source3/lib/util_str.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/lib') 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; -- cgit