libxt_sctp: fix discards 'const' qualifier
PATCH 2/3 libxt_sctp: fix discards 'const' qualifier
p is used as the return from strchr(sctp_chunk_names[i].valid_flags) which is a const char. Declare p as a const char * pointer for use addressing the warning.
Fixes:
extensions/libxt_sctp.c: In function 'parse_sctp_chunk':
extensions/libxt_sctp.c:211:40: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
211 | if ((p = strchr(sctp_chunk_names[i].valid_flags,
| ^
Signed-off-by Rudi Heitbaum <[email protected]>
--- extensions/libxt_sctp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
extensions/libxt_sctp.c +1 -1
@@ -205,7 +205,7 @@ parse_sctp_chunk(struct xt_sctp_info *einfo, if (chunk_flags) { DEBUGP("Chunk flags %s\n", chunk_flags); for (j = 0; j < strlen(chunk_flags); j++) { - char *p; + const char *p; int bit; if ((p = strchr(sctp_chunk_names[i].valid_flags,
Signature · 1 line
2.51.0