Replace 'strsep' with 'strtok'

Create issue
Issue #49 resolved
Daniel Aleksandersen created an issue

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)

  1. Daniel Aleksandersen reporter

    That looks like it should work fine. That took care of the compilation warning. Thanks

  2. Log in to comment