From: Jim Meyering Date: Tue, 8 Sep 2009 09:07:32 +0000 (+0200) Subject: openvz_conf.c: remove dead store to "p"; use strchrnul X-Git-Tag: v0.7.1~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5965de2f4db2a6c3583018f1e2956b2f1e9c9c78;p=thirdparty%2Flibvirt.git openvz_conf.c: remove dead store to "p"; use strchrnul * src/openvz_conf.c (openvzReadNetworkConf): Replace open-coded while loop with equivalent use of strchrnul. * bootstrap (modules): Add strchrnul. --- diff --git a/bootstrap b/bootstrap index 8b81e0e069..5560792368 100755 --- a/bootstrap +++ b/bootstrap @@ -89,6 +89,7 @@ send setsockopt socket stpcpy +strchrnul strndup strerror strsep diff --git a/src/openvz_conf.c b/src/openvz_conf.c index ce4fc6e5f2..be94b9eff3 100644 --- a/src/openvz_conf.c +++ b/src/openvz_conf.c @@ -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;