summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-03-01 01:11:02 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-03-01 01:11:02 +0000
commite4235f6b8403197077ab5ad536e080d09bb980ff (patch)
tree3dd2c047a149658cac38cd88fe715cd8a5365bc9
parent2853554cdb5ffd162699f2f50e65f6d5a766cacc (diff)
downloadsamba-e4235f6b8403197077ab5ad536e080d09bb980ff.tar.gz
samba-e4235f6b8403197077ab5ad536e080d09bb980ff.tar.bz2
samba-e4235f6b8403197077ab5ad536e080d09bb980ff.zip
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)
-rw-r--r--source3/lib/charcnv.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c
index df98c5a20b..d64033b498 100644
--- a/source3/lib/charcnv.c
+++ b/source3/lib/charcnv.c
@@ -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);
}
/****************************************************************************