summaryrefslogtreecommitdiff
path: root/source3/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
commit8d563a985b1091b11554fb828700e57c18ac08fb (patch)
treefd6422863bcaf9adb3743dd2ae1b0352a1a41e13 /source3/include/safe_string.h
parentc44e39065c342eaf9efb7a91499791f157433a18 (diff)
downloadsamba-8d563a985b1091b11554fb828700e57c18ac08fb.tar.gz
samba-8d563a985b1091b11554fb828700e57c18ac08fb.tar.bz2
samba-8d563a985b1091b11554fb828700e57c18ac08fb.zip
strcpy_base from HEAD and trivial fix for smbclient -L
Volker (This used to be commit 54c99ee1fbaf4541fb3fa10a9b764da1367af6d3)
Diffstat (limited to 'source3/include/safe_string.h')
-rw-r--r--source3/include/safe_string.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/include/safe_string.h b/source3/include/safe_string.h
index 26bf6cdd6f..431dc400aa 100644
--- a/source3/include/safe_string.h
+++ b/source3/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