From c1cfe3fae2e2f09f16fee346ed9a440e9d4605c4 Mon Sep 17 00:00:00 2001 From: Matthew Jordan <mjordan@digium.com> Date: Tue, 7 Apr 2015 02:03:48 +0000 Subject: [PATCH] clang compiler warnings: Fix non-literal-null-conversion warnings 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) ........ Merged revisions 434187 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 434188 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434189 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_sip.c | 4 ++-- channels/chan_skinny.c | 4 ++-- res/stasis_recording/stored.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 777bcbb6fc..d9ed538cb0 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -19728,13 +19728,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; diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c index aabac57a3a..3d56cc840d 100644 --- a/channels/chan_skinny.c +++ b/channels/chan_skinny.c @@ -2185,13 +2185,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; diff --git a/res/stasis_recording/stored.c b/res/stasis_recording/stored.c index 6cc60fd282..59c07f8dea 100644 --- a/res/stasis_recording/stored.c +++ b/res/stasis_recording/stored.c @@ -470,7 +470,7 @@ int stasis_app_stored_recording_copy(struct stasis_app_stored_recording *src_rec /* Drop the extension if specified, core will do this for us */ format = strrchr(dst_file, '.'); if (format) { - format = '\0'; + *format = '\0'; } /* See if any intermediary directories need to be made */ -- GitLab