diff options
author | Tony Crisci <tony@dubstepdish.com> | 2017-08-26 11:53:16 -0400 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2017-08-26 11:53:16 -0400 |
commit | dc7e32552dd47f400aa2d7c1f8355b89376ae60e (patch) | |
tree | c03ac55862b437372dbd29ec769947806e113dea | |
parent | 0a97b68278a621882c712b55ffe851101e5902d0 (diff) |
config: fix uninitialized variables and accept trailing for geom
-rw-r--r-- | examples/config.c | 8 |
1 files 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+"); } |