changeset 30779:106543495f5b

Simplify sscanf format strings and get rid of useless percent variable.
author reimar
date Wed, 03 Mar 2010 20:36:35 +0000
parents dc08ce042315
children 0ab92d0c1901
files libvo/geometry.c
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/geometry.c	Wed Mar 03 20:24:46 2010 +0000
+++ b/libvo/geometry.c	Wed Mar 03 20:36:35 2010 +0000
@@ -40,7 +40,6 @@
             int i;
             int ok = 0;
             for (i = 0; !ok && i < 8; i++) {
-                char percent[2];
                 width = height = xoff = yoff = xper = yper = INT_MIN;
                 switch (i) {
                 case 0:
@@ -53,10 +52,10 @@
                     ok = sscanf(vo_geometry, "+%i+%i", &xoff, &yoff) == 2;
                     break;
                 case 3:
-                    ok = sscanf(vo_geometry, "%i%%:%i%1[%]", &xper, &yper, percent) == 3;
+                    ok = sscanf(vo_geometry, "%i%%:%i%%", &xper, &yper) == 2;
                     break;
                 case 4:
-		    ok = sscanf(vo_geometry, "%i:%i%1[%]", &xoff, &yper, percent) == 3;
+		    ok = sscanf(vo_geometry, "%i:%i%%", &xoff, &yper) == 2;
                     break;
                 case 5:
                     ok = sscanf(vo_geometry, "%i%%:%i", &xper, &yoff) == 2;
@@ -65,7 +64,7 @@
                     ok = sscanf(vo_geometry, "%i:%i", &xoff, &yoff) == 2;
                     break;
                 case 7:
-                    ok = sscanf(vo_geometry, "%i%1[%]", &xper, percent) == 2;
+                    ok = sscanf(vo_geometry, "%i%%", &xper) == 1;
                     break;
                 }
             }