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;
|
break;
|
||||||
}
|
}
|
||||||
val = streamtoumax(stream, base);
|
val = streamtoumax(stream, base);
|
||||||
converted++;
|
|
||||||
// fall through
|
// fall through
|
||||||
|
|
||||||
set_integer:
|
set_integer:
|
||||||
if (!(flags & FL_SPLAT)) {
|
if (!(flags & FL_SPLAT)) {
|
||||||
|
converted++;
|
||||||
switch(rank) {
|
switch(rank) {
|
||||||
case RANK_CHAR:
|
case RANK_CHAR:
|
||||||
*va_arg(ap, unsigned 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);
|
*va_arg(ap, float *) = static_cast<float>(fval);
|
||||||
else if (rank == RANK_LONG)
|
else if (rank == RANK_LONG)
|
||||||
*va_arg(ap, double *) = static_cast<double>(fval);
|
*va_arg(ap, double *) = static_cast<double>(fval);
|
||||||
}
|
|
||||||
converted++;
|
converted++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'c': // Character
|
case 'c': // Character
|
||||||
@ -464,10 +464,11 @@ static int tvfscanf(FILE* stream, const char *format, va_list ap) {
|
|||||||
bail = BAIL_EOF;
|
bail = BAIL_EOF;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!(flags & FL_SPLAT)) *sarg++ = q;
|
if (!(flags & FL_SPLAT)) {
|
||||||
}
|
*sarg++ = q;
|
||||||
if (!bail)
|
|
||||||
converted++;
|
converted++;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 's': // String
|
case 's': // String
|
||||||
|
Loading…
Reference in New Issue
Block a user