summaryrefslogtreecommitdiff
path: root/source3/smbd/srvstr.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/srvstr.c')
-rw-r--r--source3/smbd/srvstr.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source3/smbd/srvstr.c b/source3/smbd/srvstr.c
index 55cbada10c..6ca34a2428 100644
--- a/source3/smbd/srvstr.c
+++ b/source3/smbd/srvstr.c
@@ -144,3 +144,21 @@ int srvstr_align(void *inbuf, int offset)
if (!UNICODE_FLAG(inbuf)) return 0;
return offset & 1;
}
+
+
+/****************************************************************************
+these are useful for replacing all those StrnCpy() ops for copying data
+to/from the wire
+****************************************************************************/
+
+int srvstr_push_ascii(void *dest, const char *src, int dest_len)
+{
+ return srvstr_push(NULL, dest, src, dest_len,
+ STR_ASCII|STR_CONVERT|STR_TERMINATE);
+}
+
+int srvstr_pull_ascii(char *dest, const void *src, int dest_len)
+{
+ return srvstr_pull(NULL, dest, src, dest_len, -1,
+ STR_ASCII|STR_CONVERT|STR_TERMINATE);
+}