mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-14 06:59:43 -05:00
util/token: rename TOKEN_STRLEN to TOKEN_SIZE
TOKEN_STRLEN is not actually the strlen() of the token. It's the size taken by the token included the final zero byte. Change the name to make this clearer, and remove unnecessary +1's.
This commit is contained in:
parent
3232697252
commit
55be74ad86
3 changed files with 7 additions and 6 deletions
|
|
@ -60,7 +60,7 @@ static void token_handle_destroy(struct wl_client *client,
|
|||
}
|
||||
|
||||
static bool token_init( struct wlr_xdg_activation_token_v1 *token) {
|
||||
char token_str[TOKEN_STRLEN + 1] = {0};
|
||||
char token_str[TOKEN_SIZE] = {0};
|
||||
if (!generate_token(token_str)) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -137,7 +137,7 @@ static void token_handle_commit(struct wl_client *client,
|
|||
error:;
|
||||
// Here we send a generated token, but it's invalid and can't be used to
|
||||
// request activation.
|
||||
char token_str[TOKEN_STRLEN + 1] = {0};
|
||||
char token_str[TOKEN_SIZE] = {0};
|
||||
if (!generate_token(token_str)) {
|
||||
wl_client_post_no_memory(client);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue