- changed status to open
Replace 'strsep' with 'strtok'
Issue #49
resolved
Compilation warning on Linux and Darwin for BSD-only function.
fw/hosts.c:357:21: warning: implicit declaration of function 'strsep' is invalid in C99 [-Wimplicit-function-declaration]
char *cmd = strsep(&token, sep);
^
fw/hosts.c:357:15: warning: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int' [-Wint-conversion]
char *cmd = strsep(&token, sep);
^ ~~~~~~~~~~~~~~~~~~~
fw/hosts.c:358:15: warning: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int' [-Wint-conversion]
char *address = strsep(&token, sep);
^ ~~~~~~~~~~~~~~~~~~~
fw/hosts.c:359:15: warning: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int' [-Wint-conversion]
char *type = strsep(&token, sep);
^ ~~~~~~~~~~~~~~~~~~~
Comments (5)
-
-
- changed title to Replace 'strsep' with 'strtok'
-
-
assigned issue to
-
assigned issue to
-
- changed status to resolved
Fixed in 4a79879, thanks!
-
reporter That looks like it should work fine. That took care of the compilation warning. Thanks
- Log in to comment
I'll need to rewrite it using
strtok()
or add astrsep()
shim.