From fda6cbf8b153f508d78a03a7853f998c90a044c0 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 13 Aug 2026 07:50:00 -0400 Subject: [PATCH] MT#55283 fix compiler warnings Change-Id: Idd4162cbcdddead57b730f773289786b7b4cf3fe --- daemon/call.c | 9 +++++---- recording-daemon/decoder.c | 2 +- recording-daemon/output.c | 8 ++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index bece918d3..25adfb8d7 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -443,6 +443,7 @@ void kill_calls_timer(GSList *list, const char *url) { call_t *ca; struct call_monologue *cm; char *url_prefix = NULL, *url_suffix = NULL; + const char *needle; struct xmlrpc_helper *xh = NULL; char url_buf[128]; @@ -453,10 +454,10 @@ void kill_calls_timer(GSList *list, const char *url) { if (url) { xh = g_new(__typeof(*xh), 1); url_prefix = NULL; - url_suffix = strstr(url, "%%"); - if (url_suffix) { - url_prefix = strndup(url, url_suffix - url); - url_suffix = strdup(url_suffix + 2); + needle = strstr(url, "%%"); + if (needle) { + url_prefix = strndup(url, needle - url); + url_suffix = strdup(needle + 2); } else url_suffix = strdup(url); diff --git a/recording-daemon/decoder.c b/recording-daemon/decoder.c index 138308817..1f8f99d85 100644 --- a/recording-daemon/decoder.c +++ b/recording-daemon/decoder.c @@ -24,7 +24,7 @@ // does not initialise the contained `sink` decode_t *decoder_new(const char *payload_str, const char *format, int ptime) { - char *slash = strchr(payload_str, '/'); + const char *slash = strchr(payload_str, '/'); if (!slash) { ilog(LOG_WARN, "Invalid payload format: %s", payload_str); return NULL; diff --git a/recording-daemon/output.c b/recording-daemon/output.c index 926a5ab7c..39d8a37f2 100644 --- a/recording-daemon/output.c +++ b/recording-daemon/output.c @@ -261,13 +261,13 @@ static output_t *output_new(const char *path, const metafile_t *mf, const char * case '{': // find matching end '}' p++; - end = strchr(p, '}'); - if (!end) { + const char *cend = strchr(p, '}'); + if (!cend) { ilog(LOG_ERR, "Missing ending brace '}' in file name pattern"); break; } - str fmt = STR_LEN((char *) p, end - p); - p = end; // skip over {...} + str fmt = STR_LEN((char *) p, cend - p); + p = cend; // skip over {...} output_append_str_from_ht(f, mf->metadata_parsed, &fmt); break; default: