diff options
author | Guillem Jover <guillem@debian.org> | 2008-06-30 06:14:25 +0300 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2008-06-30 07:08:34 +0300 |
commit | dca65d1a2389ed2cafca37828fe78de46758d37c (patch) | |
tree | fb3ee2b21c61563e8dfae5787462747dfb4fc2c7 /dselect/main.cc | |
parent | 4e146921a6a304e8478321d27527a4af1db2cfc3 (diff) | |
download | dpkg-dca65d1a2389ed2cafca37828fe78de46758d37c.tar.gz |
dselect: Fix compilation warnings
Surround boolean expressions with parenthesis.
Switch a for with an empty body into a while.
Diffstat (limited to 'dselect/main.cc')
-rw-r--r-- | dselect/main.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/dselect/main.cc b/dselect/main.cc index ac277e930..7b631f9b9 100644 --- a/dselect/main.cc +++ b/dselect/main.cc @@ -414,7 +414,7 @@ int refreshmenu(void) { urqresult urq_menu(void) { #define C(x) ((x)-'a'+1) - int entries, c, i; + int entries, c; entries= refreshmenu(); int cursor=0; dme(0,1); @@ -460,7 +460,9 @@ urqresult urq_menu(void) { } } else if (isalpha(c)) { c= tolower(c); - for (i=0; i<entries && gettext(menuentries[i].key)[0] != c; i++); + int i = 0; + while (i < entries && gettext(menuentries[i].key)[0] != c) + i++; if (i < entries) { dme(cursor,0); cursor=i; dme(cursor,1); } else { @@ -496,8 +498,9 @@ int main(int, const char *const *argv) { if (*argv) { const char *a; while ((a= *argv++) != 0) { - const menuentry *me; - for (me= menuentries; me->command && strcmp(me->command,a); me++); + const menuentry *me = menuentries; + while (me->command && strcmp(me->command, a)) + me++; if (!me->command) badusage(_("unknown action string `%.50s'"),a); me->fn(); } |