File timidity-server-warning-fixes.diff of Package timidity

https://bugzilla.novell.com/show_bug.cgi?id=517719

---
 interface/server_c.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

--- a/interface/server_c.c
+++ b/interface/server_c.c
@@ -468,11 +468,13 @@
     }
     if(n == 0)
 	return 1;
-    if((params[0] = strtok(buff, " \t\r\n\240")) == NULL)
-	return 0;
     *nparams = 0;
-    while(params[*nparams] && *nparams < MAX_GETCMD_PARAMS)
-	params[++(*nparams)] = strtok(NULL," \t\r\n\240");
+    do {
+	params[*nparams] = strtok(*nparams ? NULL : buff, " \t\r\n\240");
+	if (!params[*nparams])
+	    break;
+	(*nparams)++;
+    } while (*nparams < MAX_GETCMD_PARAMS);
     return 0;
 }
 
openSUSE Build Service is sponsored by