diff options
author | imura <imura@FreeBSD.org> | 2005-07-23 16:52:57 +0000 |
---|---|---|
committer | imura <imura@FreeBSD.org> | 2005-07-23 16:52:57 +0000 |
commit | 7f9185383f119c0f9bebd71e81ce08a883139417 (patch) | |
tree | b465fb269cc68f5ff565493869a1d6ff3687f320 /sys | |
parent | 78fd0ca9e8437cb4b30ebcbd4f9259592d3eeaa7 (diff) | |
download | FreeBSD-src-7f9185383f119c0f9bebd71e81ce08a883139417.zip FreeBSD-src-7f9185383f119c0f9bebd71e81ce08a883139417.tar.gz |
Temporary restore a part of rev 1.6.
We must not increase a capability of buffer size here,
because codes which call these functions expect that dst and src
are the same size.
This will cause problem when someone convert a character whose
length is different between charsets on smbfs which was changed
to use xlat16 converter.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/libkern/iconv.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/libkern/iconv.c b/sys/libkern/iconv.c index 389f21a..5bc1fdf 100644 --- a/sys/libkern/iconv.c +++ b/sys/libkern/iconv.c @@ -458,8 +458,7 @@ iconv_convstr(void *handle, char *dst, const char *src) strcpy(dst, src); return dst; } - inlen = strlen(src); - outlen = inlen * 3; + inlen = outlen = strlen(src); error = iconv_conv(handle, NULL, NULL, &p, &outlen); if (error) return NULL; @@ -484,8 +483,7 @@ iconv_convmem(void *handle, void *dst, const void *src, int size) memcpy(dst, src, size); return dst; } - inlen = size; - outlen = inlen * 3; + inlen = outlen = size; error = iconv_conv(handle, NULL, NULL, &d, &outlen); if (error) return NULL; |