Merge remote-tracking branch 'origin/master'

This commit is contained in:
Shree Devi Kumar 2018-06-08 17:16:09 +00:00
commit e614066c59
2 changed files with 14 additions and 4 deletions

View File

@ -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();

View File

@ -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;