summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schultz <das@FreeBSD.org>2012-04-22 21:28:14 +0000
committerDavid Schultz <das@FreeBSD.org>2012-04-22 21:28:14 +0000
commitf010dc7dc43bfe5249815ccbb25d3a2b8023f802 (patch)
tree3cb9e3e1475221ff0fd9273e1c40045fd33aba6f
parent01d2a7858e322d0586f9ef963856b46ade26977b (diff)
Notes
-rw-r--r--lib/libc/stdio/vfscanf.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/libc/stdio/vfscanf.c b/lib/libc/stdio/vfscanf.c
index f9b7e55a57d8a..6a6b19ccb8015 100644
--- a/lib/libc/stdio/vfscanf.c
+++ b/lib/libc/stdio/vfscanf.c
@@ -248,12 +248,12 @@ convert_wccl(FILE *fp, wchar_t *wcp, int width, const char *ccltab)
{
mbstate_t mbs;
wchar_t twc;
- int n, nchars, nconv, nread;
+ int n, nchars, nconv;
char buf[MB_CUR_MAX];
if (wcp == SUPPRESS_PTR)
wcp = &twc;
- n = nread = 0;
+ n = 0;
nchars = 0;
while (width != 0) {
if (n == MB_CUR_MAX) {
@@ -279,7 +279,6 @@ convert_wccl(FILE *fp, wchar_t *wcp, int width, const char *ccltab)
}
break;
}
- nread += n;
width--;
if (wcp != &twc)
wcp++;
@@ -298,12 +297,10 @@ convert_wccl(FILE *fp, wchar_t *wcp, int width, const char *ccltab)
fp->_flags |= __SERR;
return (-1);
}
- n = nchars;
- if (n == 0)
+ if (nchars == 0)
return (0);
*wcp = L'\0';
- /* XXX This matches historical behavior, but it's wrong. */
- return (nread + n);
+ return (nchars);
}
static __inline int