From: Guillem Jover Date: Wed, 2 Jul 2008 06:25:03 +0000 (+0300) Subject: libdpkg: Remove unneeded variable assignments and a variable X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ebc4938a254b3c194644688525ae7dceffae202;p=dpkg libdpkg: Remove unneeded variable assignments and a variable --- diff --git a/ChangeLog b/ChangeLog index 762dbe20..d969a3f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-07-02 Guillem Jover + + * lib/fields.c (convert_string): Remove unneeded variable assignments. + Get rid this way of an int variable. + 2008-07-02 Guillem Jover * lib/fields.c (convert_string): Change nvip to be const and use a diff --git a/lib/fields.c b/lib/fields.c index 7e1abf06..9fc81970 100644 --- a/lib/fields.c +++ b/lib/fields.c @@ -38,11 +38,9 @@ convert_string(const char *filename, int lno, const char *what, int otherwise, const char **endpp) { const char *ep; - int c; const struct namevalue *nvip = ivip; - ep= startp; - if (!*ep) + if (!*startp) parse_error(filename, lno, pigp, _("%s is missing"), what); while (nvip->name) { if (strncasecmp(nvip->name, startp, nvip->length)) @@ -55,10 +53,11 @@ convert_string(const char *filename, int lno, const char *what, int otherwise, parse_error(filename, lno, pigp, _("`%.*s' is not allowed for %s"), strnlen(startp, 50), startp, what); } + ep = startp + nvip->length; - c = *ep; - while (isspace(c)) c= *++ep; - if (c && !endpp) + while (isspace(*ep)) + ep++; + if (*ep && !endpp) parse_error(filename, lno, pigp, _("junk after %s"), what); if (endpp) *endpp= ep; return nvip->value;