summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2011-03-30 10:13:01 -0700
committerJeremy Allison <jra@samba.org>2011-03-30 10:13:01 -0700
commit048471d14b3ed65fe83e8f225e03af925aaf0c47 (patch)
treec7f3b4053cc8c119ee96cba1b42cb3898d018acb
parentc964744001cd231e585c5c5c9016becda145340b (diff)
downloadsamba-048471d14b3ed65fe83e8f225e03af925aaf0c47.tar.gz
samba-048471d14b3ed65fe83e8f225e03af925aaf0c47.tar.bz2
samba-048471d14b3ed65fe83e8f225e03af925aaf0c47.zip
Fix the nstring calls to use the correct sizes.
-rw-r--r--source3/lib/fstring.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source3/lib/fstring.c b/source3/lib/fstring.c
index 9c13b8db81..74c2138975 100644
--- a/source3/lib/fstring.c
+++ b/source3/lib/fstring.c
@@ -41,11 +41,11 @@ size_t push_ascii_fstring(void *dest, const char *src)
size_t push_ascii_nstring(void *dest, const char *src)
{
- ssize_t ret;
- size_t converted_size;
- ret = convert_string_error(CH_UNIX, CH_DOS, src, -1, dest, sizeof(nstring)-1, &converted_size);
- SCVAL(dest, converted_size, 0);
- return converted_size;
+ size_t converted_size = 0;
+ size_t ret;
+ ret = convert_string_error(CH_UNIX, CH_DOS, src, -1, dest, sizeof(nstring), &converted_size);
+ SCVAL(dest, sizeof(nstring)-1, 0);
+ return ret;
}
size_t pull_ascii_fstring(char *dest, const void *src)
@@ -57,7 +57,7 @@ size_t pull_ascii_fstring(char *dest, const void *src)
size_t pull_ascii_nstring(char *dest, size_t dest_len, const void *src)
{
- return pull_ascii(dest, src, dest_len, sizeof(nstring)-1, STR_TERMINATE);
+ return pull_ascii(dest, src, dest_len, sizeof(nstring), STR_TERMINATE);
}
/**