]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
clang compiler warnings: Fix non-literal-null-conversion warnings
authorMatthew Jordan <mjordan@digium.com>
Tue, 7 Apr 2015 01:58:57 +0000 (01:58 +0000)
committerMatthew Jordan <mjordan@digium.com>
Tue, 7 Apr 2015 01:58:57 +0000 (01:58 +0000)
Clang will flag errors when a char pointer is set to '\0', as opposed to a
value that the char pointer points to. This patch fixes this warning
in a variety of locations.

Review: https://reviewboard.asterisk.org/r/4551

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4551.patch submitted by dkdegroot (License 6600)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@434187 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c
channels/chan_skinny.c

index e4c1069ceef0ff3403c3c18119475033c71cf904..6a208cc142ee0851e992b17c5e2951fb9deca2bd 100644 (file)
@@ -19496,13 +19496,13 @@ static void cleanup_stale_contexts(char *new, char *old)
        char *oldcontext, *newcontext, *stalecontext, *stringp, newlist[AST_MAX_CONTEXT];
 
        while ((oldcontext = strsep(&old, "&"))) {
-               stalecontext = '\0';
+               stalecontext = NULL;
                ast_copy_string(newlist, new, sizeof(newlist));
                stringp = newlist;
                while ((newcontext = strsep(&stringp, "&"))) {
                        if (!strcmp(newcontext, oldcontext)) {
                                /* This is not the context you're looking for */
-                               stalecontext = '\0';
+                               stalecontext = NULL;
                                break;
                        } else if (strcmp(newcontext, oldcontext)) {
                                stalecontext = oldcontext;
index 6aa94a9b37667f82f4a556f264616eec404d8b12..e5f2afb973df1c2bfe9411cdaf9258c87a39b082 100644 (file)
@@ -2024,13 +2024,13 @@ static void cleanup_stale_contexts(char *new, char *old)
        char *oldcontext, *newcontext, *stalecontext, *stringp, newlist[AST_MAX_CONTEXT];
 
        while ((oldcontext = strsep(&old, "&"))) {
-               stalecontext = '\0';
+               stalecontext = NULL;
                ast_copy_string(newlist, new, sizeof(newlist));
                stringp = newlist;
                while ((newcontext = strsep(&stringp, "&"))) {
                        if (strcmp(newcontext, oldcontext) == 0) {
                                /* This is not the context you're looking for */
-                               stalecontext = '\0';
+                               stalecontext = NULL;
                                break;
                        } else if (strcmp(newcontext, oldcontext)) {
                                stalecontext = oldcontext;