From dc7e32552dd47f400aa2d7c1f8355b89376ae60e Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Sat, 26 Aug 2017 11:53:16 -0400 Subject: [PATCH] config: fix uninitialized variables and accept trailing for geom --- examples/config.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/config.c b/examples/config.c index 829350c1..1bd4672e 100644 --- a/examples/config.c +++ b/examples/config.c @@ -32,7 +32,11 @@ static struct wlr_geometry *parse_geometry(const char *str) { char *buf = strdup(str); struct wlr_geometry *geo = calloc(1, sizeof(struct wlr_geometry)); - bool has_width, has_height, has_x, has_y; + bool has_width = false; + bool has_height = false; + bool has_x = false; + bool has_y = false; + char *pch = strtok(buf, "x+"); while (pch != NULL) { errno = 0; @@ -61,7 +65,7 @@ static struct wlr_geometry *parse_geometry(const char *str) { geo->y = val; has_y = true; } else { - goto invalid_input; + break; } pch = strtok(NULL, "x+"); }