mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-28 22:00:09 +08:00
Fix varsize array for Microsoft compiler
This commit is contained in:
parent
e028274ae6
commit
809bbd9bfa
@ -1379,14 +1379,14 @@ static void AddBaselineCoordsTohOCR(const PageIterator *it,
|
||||
}
|
||||
|
||||
static void AddIdTohOCR(STRING* hocr_str, const std::string base, int num1, int num2) {
|
||||
unsigned long bufsize = base.length() + 2 * kMaxIntSize;
|
||||
char id_buffer[bufsize];
|
||||
const unsigned long BUFSIZE = 64;
|
||||
char id_buffer[BUFSIZE];
|
||||
if (num2 >= 0) {
|
||||
snprintf(id_buffer, bufsize - 1, "%s_%d_%d", base.c_str(), num1, num2);
|
||||
snprintf(id_buffer, BUFSIZE - 1, "%s_%d_%d", base.c_str(), num1, num2);
|
||||
} else {
|
||||
snprintf(id_buffer, bufsize - 1, "%s_%d", base.c_str(), num1);
|
||||
snprintf(id_buffer, BUFSIZE - 1, "%s_%d", base.c_str(), num1);
|
||||
}
|
||||
id_buffer[bufsize - 1] = '\0';
|
||||
id_buffer[BUFSIZE - 1] = '\0';
|
||||
*hocr_str += " id='";
|
||||
*hocr_str += id_buffer;
|
||||
*hocr_str += "'";
|
||||
|
Loading…
Reference in New Issue
Block a user