Skip to content

Commit 9042f1c

Browse files
committed
Cast away const in call to strstr()
My Linux man page says the arguments to this function should be const, but the compiler refuses to compile it when so. Easiest to just cast them away; the function isn't going to change them.
1 parent 25cb44f commit 9042f1c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ returning NULL if not found. The terminating NUL bytes are not compared.
252252
*/
253253

254254

255-
#define instr(haystack, needle) strstr(haystack, needle)
255+
#define instr(haystack, needle) strstr((char *) haystack, (char *) needle)
256256

257257
#ifdef HAS_MEMMEM
258258
# define ninstr(big, bigend, little, lend) \

0 commit comments

Comments
 (0)