summaryrefslogtreecommitdiff
path: root/lib/util/string_wrappers.h
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2011-05-03 13:10:01 -0700
committerJeremy Allison <jra@samba.org>2011-05-04 12:12:13 -0700
commit017e0c8d95fe8212b006e1c14aef8d96fed30674 (patch)
tree3bb209bc92d298d17255a69713981a7df18d0b8b /lib/util/string_wrappers.h
parentdeba880986b1029fa059fcfba9b2a72abf598a9b (diff)
downloadsamba-017e0c8d95fe8212b006e1c14aef8d96fed30674.tar.gz
samba-017e0c8d95fe8212b006e1c14aef8d96fed30674.tar.bz2
samba-017e0c8d95fe8212b006e1c14aef8d96fed30674.zip
Fix simple uses of safe_strcpy -> strlcpy. Easy ones where we just remove -1.
Diffstat (limited to 'lib/util/string_wrappers.h')
-rw-r--r--lib/util/string_wrappers.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/util/string_wrappers.h b/lib/util/string_wrappers.h
index 75718e942b..4e4f3ec832 100644
--- a/lib/util/string_wrappers.h
+++ b/lib/util/string_wrappers.h
@@ -47,10 +47,10 @@ size_t __unsafe_string_function_usage_here_size_t__(void);
/* String copy functions - macro hell below adds 'type checking' (limited,
but the best we can do in C) */
-#define fstrcpy(d,s) safe_strcpy((d),(s),sizeof(fstring)-1)
-#define fstrcat(d,s) safe_strcat((d),(s),sizeof(fstring)-1)
-#define nstrcpy(d,s) safe_strcpy((d), (s),sizeof(nstring)-1)
-#define unstrcpy(d,s) safe_strcpy((d), (s),sizeof(unstring)-1)
+#define fstrcpy(d,s) strlcpy((d),(s) ? (s) : "",sizeof(fstring))
+#define fstrcat(d,s) strlcpy((d),(s) ? (s) : "",sizeof(fstring))
+#define nstrcpy(d,s) strlcpy((d), (s) ? (s) : "",sizeof(nstring))
+#define unstrcpy(d,s) strlcpy((d), (s) ? (s) : "",sizeof(unstring))
/* the addition of the DEVELOPER checks in safe_strcpy means we must
* update a lot of code. To make this a little easier here are some