summaryrefslogtreecommitdiff
path: root/source/include/safe_string.h
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2003-03-10 16:54:57 +0000
committerVolker Lendecke <vlendec@samba.org>2003-03-10 16:54:57 +0000
commit54c99ee1fbaf4541fb3fa10a9b764da1367af6d3 (patch)
tree646549e0d615404e0b93b092b414efe19788c6b5 /source/include/safe_string.h
parent944752024ba6ab762b12c29ee867e37401dac12b (diff)
downloadsamba-54c99ee1fbaf4541fb3fa10a9b764da1367af6d3.tar.gz
strcpy_base from HEAD and trivial fix for smbclient -L
Volker
Diffstat (limited to 'source/include/safe_string.h')
-rw-r--r--source/include/safe_string.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/include/safe_string.h b/source/include/safe_string.h
index 26bf6cdd6fb..431dc400aa1 100644
--- a/source/include/safe_string.h
+++ b/source/include/safe_string.h
@@ -87,4 +87,13 @@ char * __unsafe_string_function_usage_here__(void);
#define strlower(s) strlower_m(s)
#define strupper(s) strupper_m(s)
+/* 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
+ * functions that provide the lengths with less pain */
+#define pstrcpy_base(dest, src, pstring_base) \
+ safe_strcpy(dest, src, sizeof(pstring)-PTR_DIFF(dest,pstring_base)-1)
+
+#define push_pstring_base(dest, src, pstring_base) \
+ push_ascii(dest, src, sizeof(pstring)-PTR_DIFF(dest,pstring_base)-1, STR_TERMINATE)
+
#endif