diff options
author | Ian Fan <ianfan0@gmail.com> | 2018-08-01 16:02:56 +0100 |
---|---|---|
committer | Ian Fan <ianfan0@gmail.com> | 2018-08-06 14:17:58 +0100 |
commit | 3a980857cba80719e70ee3960b5b3b12923fda81 (patch) | |
tree | 419c40ffd75396f3c3f88f566ec710604d4a5ef8 | |
parent | commands: complete move implementation (diff) | |
download | sway-3a980857cba80719e70ee3960b5b3b12923fda81.tar.gz sway-3a980857cba80719e70ee3960b5b3b12923fda81.tar.zst sway-3a980857cba80719e70ee3960b5b3b12923fda81.zip |
commands: better type for con_id string length
-rw-r--r-- | sway/criteria.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sway/criteria.c b/sway/criteria.c index 2fa9878b..9077aa9b 100644 --- a/sway/criteria.c +++ b/sway/criteria.c | |||
@@ -366,9 +366,9 @@ static char *get_focused_prop(enum criteria_token token) { | |||
366 | return NULL; | 366 | return NULL; |
367 | } | 367 | } |
368 | size_t id = view->swayc->id; | 368 | size_t id = view->swayc->id; |
369 | int len = snprintf(NULL, 0, "%zu", id) + 1; | 369 | size_t id_size = snprintf(NULL, 0, "%zu", id) + 1; |
370 | char *id_str = malloc(len); | 370 | char *id_str = malloc(id_size); |
371 | snprintf(id_str, len, "%zu", id); | 371 | snprintf(id_str, id_size, "%zu", id); |
372 | value = id_str; | 372 | value = id_str; |
373 | break; | 373 | break; |
374 | case T_CON_MARK: // These do not support __focused__ | 374 | case T_CON_MARK: // These do not support __focused__ |