mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-12 07:29:07 +08:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
e614066c59
@ -43,6 +43,7 @@
|
||||
#endif // _WIN32
|
||||
|
||||
#include <algorithm>
|
||||
#include <clocale>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <iterator>
|
||||
@ -185,7 +186,15 @@ TessBaseAPI::TessBaseAPI()
|
||||
rect_width_(0),
|
||||
rect_height_(0),
|
||||
image_width_(0),
|
||||
image_height_(0) {}
|
||||
image_height_(0) {
|
||||
const char *locale;
|
||||
locale = std::setlocale(LC_ALL, nullptr);
|
||||
ASSERT_HOST(!strcmp(locale, "C"));
|
||||
locale = std::setlocale(LC_CTYPE, nullptr);
|
||||
ASSERT_HOST(!strcmp(locale, "C"));
|
||||
locale = std::setlocale(LC_NUMERIC, nullptr);
|
||||
ASSERT_HOST(!strcmp(locale, "C"));
|
||||
}
|
||||
|
||||
TessBaseAPI::~TessBaseAPI() {
|
||||
End();
|
||||
|
@ -472,8 +472,10 @@ static int tvfscanf(FILE* stream, const char *format, va_list ap) {
|
||||
|
||||
case 's': // String
|
||||
{
|
||||
char *sp;
|
||||
sp = sarg = va_arg(ap, char *);
|
||||
if (!(flags & FL_SPLAT)) {
|
||||
sarg = va_arg(ap, char *);
|
||||
}
|
||||
char *sp = sarg;
|
||||
while (width--) {
|
||||
q = fgetc(stream);
|
||||
if (isspace(static_cast<unsigned char>(q)) || q <= 0) {
|
||||
@ -488,7 +490,6 @@ static int tvfscanf(FILE* stream, const char *format, va_list ap) {
|
||||
} else if (!(flags & FL_SPLAT)) {
|
||||
*sp = '\0'; // Terminate output
|
||||
converted++;
|
||||
} else {
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user