nbd-server: use modern alternative to legacy index() function
authorPeter Korsgaard <jacmet@sunsite.dk>
Mon, 5 Dec 2011 22:40:42 +0000 (23:40 +0100)
committerWouter Verhelst <w@uter.be>
Tue, 6 Dec 2011 08:44:25 +0000 (09:44 +0100)
index() was marked as obsolete by susv3, and isn't available on uClibc
in some configurations, so use the equivalent strchr() instead:

http://pubs.opengroup.org/onlinepubs/009695399/functions/index.html

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
nbd-server.c

index 4bbf413..810673e 100644 (file)
@@ -324,7 +324,7 @@ int authorized_client(CLIENT *opts) {
   
        inet_aton(opts->clientname, &client);
        while (fgets(line,LINELEN,f)!=NULL) {
-               if((tmp=index(line, '/'))) {
+               if((tmp=strchr(line, '/'))) {
                        if(strlen(line)<=tmp-line) {
                                msg4(LOG_CRIT, ERRMSG, line, opts->server->authname);
                                return 0;