From 2ebc4938a254b3c194644688525ae7dceffae202 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Wed, 2 Jul 2008 09:25:03 +0300 Subject: [PATCH] libdpkg: Remove unneeded variable assignments and a variable --- ChangeLog | 5 +++++ lib/fields.c | 11 +++++------ 2 files changed, 10 insertions(+), 6 deletions(-) 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; -- 2.39.5