-
Notifications
You must be signed in to change notification settings - Fork 376
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 most strlen with strnlen_s #747
Conversation
#define stricmp strcasecmp | ||
#define strnicmp strncasecmp | ||
#define strnlen_s(s) strnlen_s(s, INT_MAX) |
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.
There are two definitions for strnlen_s? Why not put this line in Stringfunctions.h? Then you should be able to remove the definition from StringFunctions.cpp.
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.
No this is just a macro, mainly for WIN32, because strnlen_s() is builtin. Besides, StringFunctions.h is not included in Windows build
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.
Ok I see.
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.
btw have you checked that this compiles on all platforms? I'm just a bit concerned because strnlen_s is part of the c11 standard, not c++11.
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.
yes, I've run customized in Build and Functional Test plans last Friday
Codecov Report
@@ Coverage Diff @@
## dev #747 +/- ##
==========================================
+ Coverage 78.86% 78.91% +0.05%
==========================================
Files 25 25
Lines 7149 7157 +8
==========================================
+ Hits 5638 5648 +10
+ Misses 1511 1509 -2
Continue to review full report at Codecov.
|
This change is