]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Fix discarded-qualifiers warnings in channels.c, httpc.c, webui.c
authorcopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Wed, 6 May 2026 09:30:02 +0000 (09:30 +0000)
committerFlole <Flole998@users.noreply.github.com>
Sat, 16 May 2026 19:02:27 +0000 (21:02 +0200)
Agent-Logs-Url: https://github.com/tvheadend/tvheadend/sessions/bc91d39b-dbd2-4eac-8b9d-3caf92a47726

Co-authored-by: Flole998 <9951871+Flole998@users.noreply.github.com>
src/channels.c
src/httpc.c
src/webui/webui.c

index 5535b46e2e50b8cbf52f775ef77b68bd1799fb1e..4bc422a5cd6003d9a7c565359400e07ad98d15d9 100644 (file)
@@ -710,15 +710,16 @@ channel_find_by_number ( const char *no )
   channel_t *ch;
   uint32_t maj, min = 0;
   uint64_t cno;
-  char *s;
+  char *buf, *s;
 
   if (no == NULL)
     return NULL;
-  if ((s = strchr(no, '.')) != NULL) {
+  buf = tvh_strdupa(no);
+  if ((s = strchr(buf, '.')) != NULL) {
     *s = '\0';
     min = atoi(s + 1);
   }
-  maj = atoi(no);
+  maj = atoi(buf);
   cno = (uint64_t)maj * CHANNEL_SPLIT + (uint64_t)min;
   CHANNEL_FOREACH(ch)
     if(channel_get_number(ch) == cno)
index 9f469752bd5a5e31d86a26d3ea59686026bacd4c..84adaed0de4af27f19344087d9c34d03c3b986ee 100644 (file)
@@ -756,9 +756,10 @@ http_client_finish( http_client_t *hc )
 static int
 http_client_parse_arg( http_arg_list_t *list, const char *p )
 {
+  char *buf = tvh_strdupa(p);
   char *d, *t;
 
-  d = strchr(p, ':');
+  d = strchr(buf, ':');
   if (d) {
     *d++ = '\0';
     while (*d && *d <= ' ')
@@ -766,7 +767,7 @@ http_client_parse_arg( http_arg_list_t *list, const char *p )
     t = d + strlen(d);
     while (--t != d && *t <= ' ')
       *t = '\0';
-    http_arg_set(list, p, d);
+    http_arg_set(list, buf, d);
     return 0;
   }
   return -EINVAL;
index d2669389d330150b62d8a1e9f4d70796e5ae6bad..68a74aad3a37fbf3ad2b48ae309732bbf196bb14 100644 (file)
@@ -2258,7 +2258,7 @@ http_serve_file(http_connection_t *hc, const char *fname,
   int fd, ret, close_ret;
   struct stat st;
   const char *range;
-  char *basename;
+  const char *basename;
   char *str, *str0;
   char range_buf[255];
   char *disposition = NULL;