From 5965de2f4db2a6c3583018f1e2956b2f1e9c9c78 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 8 Sep 2009 11:07:32 +0200 Subject: [PATCH] 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. --- bootstrap | 1 + src/openvz_conf.c | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) 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;