diff options
author | imura <imura@FreeBSD.org> | 2005-07-29 13:22:37 +0000 |
---|---|---|
committer | imura <imura@FreeBSD.org> | 2005-07-29 13:22:37 +0000 |
commit | 3c148b71eb7204eb8ec0f9a9dc000571f0e9730f (patch) | |
tree | 549cc36b1d29a5047dca121ca0e375b41b375c0c /sys/netsmb | |
parent | bea55b64d3f045f1f8013655fd5e3b78e98673a0 (diff) | |
download | FreeBSD-src-3c148b71eb7204eb8ec0f9a9dc000571f0e9730f.zip FreeBSD-src-3c148b71eb7204eb8ec0f9a9dc000571f0e9730f.tar.gz |
Change API of mb_copy_t in libmchain so that netsmb can handle
multibyte character share name correctly.
Reviewed by: bp
Diffstat (limited to 'sys/netsmb')
-rw-r--r-- | sys/netsmb/smb_subr.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/netsmb/smb_subr.c b/sys/netsmb/smb_subr.c index 0fb48ec..b8dab57 100644 --- a/sys/netsmb/smb_subr.c +++ b/sys/netsmb/smb_subr.c @@ -319,11 +319,20 @@ smb_maperror(int eclass, int eno) } static int -smb_copy_iconv(struct mbchain *mbp, c_caddr_t src, caddr_t dst, size_t len) +smb_copy_iconv(struct mbchain *mbp, c_caddr_t src, caddr_t dst, + size_t *srclen, size_t *dstlen) { - size_t outlen = len; + int error; + size_t inlen = *srclen, outlen = *dstlen; - return iconv_conv((struct iconv_drv*)mbp->mb_udata, &src, &len, &dst, &outlen); + error = iconv_conv((struct iconv_drv*)mbp->mb_udata, &src, &inlen, + &dst, &outlen); + if (inlen != *srclen || outlen != *dstlen) { + *srclen -= inlen; + *dstlen -= outlen; + return 0; + } else + return error; } int |