[PATCH wayland 1/6] scanner: Add missing brackets

Jonas Ådahl jadahl at gmail.com
Mon Dec 28 18:10:09 PST 2015


A statement was added at the same indentation level as the true branch
of the if statement, but since there were no brackets, it would be
executed independently of the result of the if condition.

Signed-off-by: Jonas Ådahl <jadahl at gmail.com>
---
 src/scanner.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/scanner.c b/src/scanner.c
index 406519f..3f79a44 100644
--- a/src/scanner.c
+++ b/src/scanner.c
@@ -612,10 +612,11 @@ start_element(void *data, const char *element_name, const char **atts)
 	for (i = 0; atts[i]; i += 2) {
 		if (strcmp(atts[i], "name") == 0)
 			name = atts[i + 1];
-		if (strcmp(atts[i], "version") == 0)
+		if (strcmp(atts[i], "version") == 0) {
 			version = strtouint(atts[i + 1]);
 			if (version == -1)
 				fail(&ctx->loc, "wrong version (%s)", atts[i + 1]);
+		}
 		if (strcmp(atts[i], "type") == 0)
 			type = atts[i + 1];
 		if (strcmp(atts[i], "value") == 0)
-- 
2.4.3



More information about the wayland-devel mailing list