]> xenbits.xensource.com Git - libvirt.git/commitdiff
openvz_conf.c: remove dead store to "p"; use strchrnul
authorJim Meyering <meyering@redhat.com>
Tue, 8 Sep 2009 09:07:32 +0000 (11:07 +0200)
committerJim Meyering <meyering@redhat.com>
Wed, 9 Sep 2009 10:11:34 +0000 (12:11 +0200)
* src/openvz_conf.c (openvzReadNetworkConf): Replace open-coded
while loop with equivalent use of strchrnul.
* bootstrap (modules): Add strchrnul.

bootstrap
src/openvz_conf.c

index 8b81e0e069330292235e6095aca06982d92f577c..5560792368a3f760049bcd921862ab81798d10c0 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -89,6 +89,7 @@ send
 setsockopt
 socket
 stpcpy
+strchrnul
 strndup
 strerror
 strsep
index ce4fc6e5f2c9675aa3c3efc5825c429e19e58521..be94b9eff310635efcad629f26121c7bb267fb4c 100644 (file)
@@ -239,15 +239,14 @@ openvzReadNetworkConf(virConnectPtr conn,
 
             net->type = VIR_DOMAIN_NET_TYPE_BRIDGE;
 
-            char *p = token, *next = token;
+            char *p = token;
             char cpy_temp[32];
             int len;
 
             /*parse string*/
             do {
-                while (*next != '\0' && *next != ',') next++;
+                char *next = strchrnul (token, ',');
                 if (STRPREFIX(p, "ifname=")) {
-                    p += 7;
                     /* skip in libvirt */
                 } else if (STRPREFIX(p, "host_ifname=")) {
                     p += 12;