mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-18 11:28:51 +08:00
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:
parent
c8e27cb8f8
commit
484b47bc5d
@ -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,9 +451,9 @@ 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++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'c': // Character
|
||||
@ -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 (!bail)
|
||||
if (!(flags & FL_SPLAT)) {
|
||||
*sarg++ = q;
|
||||
converted++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 's': // String
|
||||
|
Loading…
Reference in New Issue
Block a user