Skip to content
This repository has been archived by the owner on Mar 17, 2022. It is now read-only.

Commit

Permalink
Fix size of string holding symbol and confidence
Browse files Browse the repository at this point in the history
We're printing "%s|%.2f" which could end up in "%s|100.00" so it's "strlen(utfText) + 7".
  • Loading branch information
Robyer committed May 11, 2017
1 parent af9fc83 commit bdd2fe7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobjectArray Java_com_googlecode_tesseract_android_ResultIterator_nativeGetSymbo
const char *utfText = cb.GetUTF8Text();

// Add each string to the object array elements
char newString[strlen(utfText) + 5];
char newString[strlen(utfText) + 7];
sprintf(newString, "%s|%.2f", utfText, cb.Confidence());
env->SetObjectArrayElement(ret, i, env->NewStringUTF(newString));

Expand Down

0 comments on commit bdd2fe7

Please sign in to comment.