#1323 Restores the NULL string where appropriate#1325
Merged
zwoop merged 1 commit intoapache:masterfrom Jan 14, 2017
Merged
Conversation
|
FreeBSD build successful! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/1331/ for details. |
|
Linux build successful! See https://ci.trafficserver.apache.org/job/Github-Linux/1225/ for details. |
|
FreeBSD build successful! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/1332/ for details. |
|
Linux build successful! See https://ci.trafficserver.apache.org/job/Github-Linux/1226/ for details. |
Contributor
Author
|
Any takers on reviewing this? |
jpeach
approved these changes
Jan 13, 2017
| break; | ||
| case RECD_STRING: | ||
| if (data_string && strcmp((data_string), "nullptr") == 0) { | ||
| if (data_string && (strlen(data_string) == 4) && strncmp((data_string), "NULL", 4) == 0) { |
Contributor
There was a problem hiding this comment.
Why do you need the extra strlen here?
Contributor
Author
There was a problem hiding this comment.
Because amc wanted me to use strncmp(), so if you don't check the length, then it'd also match any string starting with NULL.
Contributor
|
Afaict this is just strcmp then?
… On Jan 13, 2017, at 7:03 PM, Leif Hedstrom ***@***.***> wrote:
@zwoop commented on this pull request.
In lib/records/RecUtils.cc:
> @@ -419,7 +419,7 @@ RecDataSetFromString(RecDataT data_type, RecData *data_dst, const char *data_str
data_src.rec_float = atof(data_string);
break;
case RECD_STRING:
- if (data_string && strcmp((data_string), "nullptr") == 0) {
+ if (data_string && (strlen(data_string) == 4) && strncmp((data_string), "NULL", 4) == 0) {
Because amc wanted me to use strncmp(), so if you don't check the length, then it'd also match any string starting with NULL.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.