diff options
author | Tim Potter <tpot@samba.org> | 2003-05-28 00:56:51 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2003-05-28 00:56:51 +0000 |
commit | 5c385ce833a12eef4a9f763903a44c1dee1e7d76 (patch) | |
tree | f09d54a5493387d443ac0ffcd34889072e284447 /source3 | |
parent | c593b15e762f82eb218fa5ff0b6f935995e1c82f (diff) | |
download | samba-5c385ce833a12eef4a9f763903a44c1dee1e7d76.tar.gz samba-5c385ce833a12eef4a9f763903a44c1dee1e7d76.tar.bz2 samba-5c385ce833a12eef4a9f763903a44c1dee1e7d76.zip |
Merge of pull_ascii() and pull_ucs2() termination fixes from 3.0
(This used to be commit bd97a76388b3f16d287c25579f02afe072cdec25)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/charcnv.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c index c3360bbb65..eb427cc0fc 100644 --- a/source3/lib/charcnv.c +++ b/source3/lib/charcnv.c @@ -420,6 +420,8 @@ size_t pull_ascii(char *dest, const void *src, size_t dest_len, size_t src_len, if (dest_len) dest[MIN(ret, dest_len-1)] = 0; + else + dest[0] = 0; return src_len; } @@ -629,6 +631,8 @@ size_t pull_ucs2(const void *base_ptr, char *dest, const void *src, size_t dest_ ret = convert_string(CH_UCS2, CH_UNIX, src, src_len, dest, dest_len); if (dest_len) dest[MIN(ret, dest_len-1)] = 0; + else + dest[0] = 0; return src_len; } |