[Asterisk-code-review] json.c/strings.c - Add a couple of utility functions (asterisk[13])

Kevin Harwell asteriskteam at digium.com
Tue Feb 19 11:52:48 CST 2019


Kevin Harwell has posted comments on this change. ( https://gerrit.asterisk.org/10977 )

Change subject: json.c/strings.c - Add a couple of utility functions
......................................................................


Patch Set 4:

(1 comment)

https://gerrit.asterisk.org/#/c/10977/4/main/strings.c
File main/strings.c:

https://gerrit.asterisk.org/#/c/10977/4/main/strings.c@252
PS4, Line 252: 	if (!str1 || !str2) {
> Should (!str1 && !str2) return 0?  Two NULL's are equal..
two NULL's are equal yes, but for this function NULL's are not considered matching strings, or strings at all.

This function is to be used in those situations where you want to compare two strings for equality, but need to first make sure one or the other, or both are not NULL otherwise strcmp would be undefined.

If you feel this has limited use, or is more confusing than worthwhile then I can remove the function altogether. The use case may be less often than I imagined.



-- 
To view, visit https://gerrit.asterisk.org/10977
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: I26f0a16d61537505eb41b4b05ef2e6d67fc2541b
Gerrit-Change-Number: 10977
Gerrit-PatchSet: 4
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Friendly Automation (1000185)
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Comment-Date: Tue, 19 Feb 2019 17:52:48 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190219/18cffc66/attachment-0001.html>


More information about the asterisk-code-review mailing list