summaryrefslogtreecommitdiffstats
path: root/source/lib/util_str.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-07-08 18:57:58 +0000
committerLuke Leighton <lkcl@samba.org>1999-07-08 18:57:58 +0000
commit47e54d049a4de3c2154b1e5edc3234b88bcc065f (patch)
tree8ff8b549e9efede80800f672beeadb3ff507bd82 /source/lib/util_str.c
parent389c17a225884b39d097dc0851a794d3669fdc31 (diff)
downloadsamba-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.c5
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;