From e2a8a062d717dba68e9c9fe5bd0df2e6fcc83f0e Mon Sep 17 00:00:00 2001 From: Rob Davies Date: Thu, 7 May 2026 16:44:59 +0100 Subject: [PATCH] Fix warning about discarding const in init_index2() The warning is a bit odd, as the variable in question is initialised from strstr() which is supposed to return `char *` (even though the input is `const char *`). However, as there are no writes to the new pointer, there's no problem with changing it to a `const char *`. Signed-off-by: Rob Davies --- version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.c b/version.c index 4ebf220f..e3e20693 100644 --- a/version.c +++ b/version.c @@ -160,7 +160,7 @@ int init_index2(htsFile *fh, bcf_hdr_t *hdr, const char *fname, if ( !fname || !*fname || !strcmp(fname, "-") ) return -1; - char *delim = strstr(fname, HTS_IDX_DELIM); + const char *delim = strstr(fname, HTS_IDX_DELIM); if (delim) { delim += strlen(HTS_IDX_DELIM); *idx_fname = strdup(delim);