chiark / gitweb /
Fix build with C23 const generic return from strchr
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 10 Sep 2026 21:25:19 +0000 (22:25 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 10 Sep 2026 21:27:00 +0000 (22:27 +0100)
Closes: #1128551
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
duct.c
infile.c

diff --git a/duct.c b/duct.c
index b76cdf8b3dbd49e7b10c2fc4aea1fb1738bdd973..82b00bd28e9a4c803b0cf6b548392dda591dd698 100644 (file)
--- a/duct.c
+++ b/duct.c
@@ -222,7 +222,7 @@ static void parse_options(const Option *options, char ***argvp) {
       const Option *o;
       if (a=='-') {
        arg++;
-       char *equals= strchr(arg,'=');
+       const char *equals= strchr(arg,'=');
        unsigned len= equals ? (size_t)(equals - arg) : strlen(arg);
        for (o=options; o->shrt || o->lng; o++)
          if (strlen(o->lng) == len && !memcmp(o->lng,arg,len))
index 9a1af7e4af0658a5fdcef66ccbafe9c1c439b1b5..acba228742345a8cb2d8672b40732b24bf699fde 100644 (file)
--- a/infile.c
+++ b/infile.c
@@ -121,7 +121,7 @@ static void *feedfile_got_article(oop_source *lp, oop_read *rd,
     return OOP_CONTINUE;
   }
 
-  char *space= strchr(data,' ');
+  const char *space= strchr(data,' ');
   int tokenlen= space-data;
   int midlen= (int)recsz-tokenlen-1;
   if (midlen <= 2) X_BAD_DATA("no room for messageid");