-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace strcpy and strncpy by new inline helper function #4250
Conversation
We should name it |
@@ -310,11 +308,7 @@ char *LTRResultIterator::WordTruthUTF8Text() const { | |||
if (!HasTruthString()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we change this function return type to std::string?
char *LTRResultIterator::WordTruthUTF8Text() const {
to
std::string LTRResultIterator::WordTruthUTF8Text() const {
and also all calling sites?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even better, WordTruthUTF8Text
should be removed because it is not used anywhere. But that can be done in a separate commit.
That function is part of the public API, so I think we have to keep it as it is.
That's a little bit long, but a comment which basically says the same thing could be added in helpers.h. |
@@ -310,11 +308,7 @@ char *LTRResultIterator::WordTruthUTF8Text() const { | |||
if (!HasTruthString()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even better, WordTruthUTF8Text
should be removed because it is not used anywhere. But that can be done in a separate commit.
That function is part of the public API, so I think we have to keep it as it is.
@@ -35,6 +35,15 @@ | |||
|
|||
namespace tesseract { | |||
|
|||
// Copy a std::string to a newly allocated char *. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Copy a std::string to a newly allocated char *. | |
// Copy a std::string to a newly allocated char *. | |
// TODO: Remove this function once the related code has been converted to use std::string. |
Signed-off-by: Stefan Weil <[email protected]>
No description provided.