summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-08-22 22:44:06 +0000
committerAndrew Tridgell <tridge@samba.org>2002-08-22 22:44:06 +0000
commita10519049eaff027056e82440444638b68b8cf3a (patch)
tree7d5ca90fae63ab28f480ed584b87c72bef438644 /source3
parent600558a2eaa953f42cfced3912612f8e9ce2e135 (diff)
downloadsamba-a10519049eaff027056e82440444638b68b8cf3a.tar.gz
samba-a10519049eaff027056e82440444638b68b8cf3a.tar.bz2
samba-a10519049eaff027056e82440444638b68b8cf3a.zip
added a useful unistr2 display function
(This used to be commit f4581133649b5208d8f91c4995ef60579e04b6f6)
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/util_unistr.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c
index ba02819bdc..eb47252413 100644
--- a/source3/lib/util_unistr.c
+++ b/source3/lib/util_unistr.c
@@ -218,6 +218,16 @@ void unistr2_to_ascii(char *dest, const UNISTR2 *str, size_t maxlen)
pull_ucs2(NULL, dest, str->buffer, maxlen, str->uni_str_len*2, STR_NOALIGN);
}
+/*******************************************************************
+give a static string for displaying a UNISTR2
+********************************************************************/
+const char *unistr2_static(const UNISTR2 *str)
+{
+ static pstring ret;
+ unistr2_to_ascii(ret, str, sizeof(ret));
+ return ret;
+}
+
/*******************************************************************
duplicate a UNISTR2 string into a null terminated char*