mirror of
https://github.com/samba-team/samba.git
synced 2025-02-04 17:47:26 +03:00
Fix up the pull_utf8_fstring/pstring functions, and add their push eqivilants.
patch by Hasch@t-online.de (Juergen Hasch) Andrew Bartlett (This used to be commit ba2570f518e07c95b952fb824a2d0b040b912bcc)
This commit is contained in:
parent
2853554cdb
commit
e4235f6b84
@ -400,7 +400,7 @@ flags can have:
|
||||
dest_len is the maximum length allowed in the destination. If dest_len
|
||||
is -1 then no maxiumum is used
|
||||
****************************************************************************/
|
||||
int push_utf8(const void *base_ptr, void *dest, const char *src, int dest_len, int flags)
|
||||
int push_utf8(void *dest, const char *src, int dest_len, int flags)
|
||||
{
|
||||
int src_len = strlen(src);
|
||||
pstring tmpbuf;
|
||||
@ -423,6 +423,16 @@ int push_utf8(const void *base_ptr, void *dest, const char *src, int dest_len, i
|
||||
return convert_string(CH_UNIX, CH_UTF8, src, src_len, dest, dest_len);
|
||||
}
|
||||
|
||||
int push_utf8_fstring(void *dest, const char *src)
|
||||
{
|
||||
return push_utf8(dest, src, sizeof(fstring), STR_TERMINATE);
|
||||
}
|
||||
|
||||
int push_utf8_pstring(void *dest, const char *src)
|
||||
{
|
||||
return push_utf8(dest, src, sizeof(pstring), STR_TERMINATE);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
copy a string from a ucs2 source to a unix char* destination
|
||||
flags can have:
|
||||
@ -476,7 +486,7 @@ src_len is the length of the source area in bytes
|
||||
return the number of bytes occupied by the string in src
|
||||
the resulting string in "dest" is always null terminated
|
||||
****************************************************************************/
|
||||
int pull_utf8(const void *base_ptr, char *dest, const void *src, int dest_len, int src_len, int flags)
|
||||
int pull_utf8(char *dest, const void *src, int dest_len, int src_len, int flags)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@ -494,12 +504,12 @@ int pull_utf8(const void *base_ptr, char *dest, const void *src, int dest_len, i
|
||||
|
||||
int pull_utf8_pstring(char *dest, const void *src)
|
||||
{
|
||||
return pull_utf8(NULL, dest, src, sizeof(pstring), -1, STR_TERMINATE);
|
||||
return pull_utf8(dest, src, sizeof(pstring), -1, STR_TERMINATE);
|
||||
}
|
||||
|
||||
int pull_utf8_fstring(char *dest, const void *src)
|
||||
{
|
||||
return pull_utf8(NULL, dest, src, sizeof(fstring), -1, STR_TERMINATE);
|
||||
return pull_utf8(dest, src, sizeof(fstring), -1, STR_TERMINATE);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
Loading…
x
Reference in New Issue
Block a user