[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Nbd] [PATCH] nbd-server: use modern alternative to legacy index() function



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@...726...>
---
 nbd-server.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/nbd-server.c b/nbd-server.c
index 4bbf413..810673e 100644
--- a/nbd-server.c
+++ b/nbd-server.c
@@ -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;
-- 
1.7.7.1




Reply to: