1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

added a useful unistr2 display function

(This used to be commit f4581133649b5208d8f91c4995ef60579e04b6f6)
This commit is contained in:
Andrew Tridgell 2002-08-22 22:44:06 +00:00
parent 600558a2ea
commit a10519049e

View File

@ -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*