Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Shreeshrii committed Jun 8, 2018
2 parents ea7f480 + e7c1e07 commit e614066
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
11 changes: 10 additions & 1 deletion src/api/baseapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#endif // _WIN32

#include <algorithm>
#include <clocale>
#include <fstream>
#include <iostream>
#include <iterator>
Expand Down Expand Up @@ -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();
Expand Down
7 changes: 4 additions & 3 deletions src/ccutil/scanutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
Expand Down

0 comments on commit e614066

Please sign in to comment.