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 /sway | |
parent | 69e1a421fc2ccecd93f79c9dd0537671138bb0a9 (diff) |
commands: better type for con_id string length
Diffstat (limited to 'sway')
-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) { return NULL; } size_t id = view->swayc->id; - int len = snprintf(NULL, 0, "%zu", id) + 1; - char *id_str = malloc(len); - snprintf(id_str, len, "%zu", id); + size_t id_size = snprintf(NULL, 0, "%zu", id) + 1; + char *id_str = malloc(id_size); + snprintf(id_str, id_size, "%zu", id); value = id_str; break; case T_CON_MARK: // These do not support __focused__ |