Fixed tfscanf return value with * modifier

git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@1087 d0cd1f9f-072b-0410-8dd7-cf729c803f20
This commit is contained in:
theraysmith@gmail.com 2014-04-29 04:30:47 +00:00
parent c8e27cb8f8
commit 484b47bc5d

View File

@ -399,11 +399,11 @@ static int tvfscanf(FILE* stream, const char *format, va_list ap) {
break;
}
val = streamtoumax(stream, base);
converted++;
// fall through
set_integer:
if (!(flags & FL_SPLAT)) {
converted++;
switch(rank) {
case RANK_CHAR:
*va_arg(ap, unsigned char *)
@ -451,8 +451,8 @@ static int tvfscanf(FILE* stream, const char *format, va_list ap) {
*va_arg(ap, float *) = static_cast<float>(fval);
else if (rank == RANK_LONG)
*va_arg(ap, double *) = static_cast<double>(fval);
converted++;
}
converted++;
}
break;
@ -464,10 +464,11 @@ static int tvfscanf(FILE* stream, const char *format, va_list ap) {
bail = BAIL_EOF;
break;
}
if (!(flags & FL_SPLAT)) *sarg++ = q;
if (!(flags & FL_SPLAT)) {
*sarg++ = q;
converted++;
}
}
if (!bail)
converted++;
break;
case 's': // String