[PATCH:xcursorgen] Fix -image argument parsing to not shadow "i" variable

Alan Coopersmith alan.coopersmith at oracle.com
Tue Feb 14 19:56:19 PST 2012


Also avoids starting at the wrong argument if -image is not the first
flag passed to xcompmgr (though that's not really supported in the
current syntax).

Fixes gcc warning:
xcursorgen.c: In function `main':
xcursorgen.c:394: warning: declaration of 'i' shadows a previous local
xcursorgen.c:377: warning: shadowed declaration is here

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 xcursorgen.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/xcursorgen.c b/xcursorgen.c
index 195d6f6..fd41a77 100644
--- a/xcursorgen.c
+++ b/xcursorgen.c
@@ -391,13 +391,11 @@ main (int argc, char *argv[])
         }
       if (strcmp (argv[i], "-image") == 0)
         {
-	  int i = 2;
 	  int ret = 0;
-	  while (argv[i])
+	  while (argv[++i])
 	  {
 	    if (check_image (argv[i]))
 	      ret = i;
-	    i++;
 	  }
 	  return ret;
 	}
-- 
1.7.3.2



More information about the xorg-devel mailing list