diff --git a/build-utils/atoms-int.sh b/build-utils/atoms-int.sh index dde2fe9f..5f8f127f 100755 --- a/build-utils/atoms-int.sh +++ b/build-utils/atoms-int.sh @@ -14,7 +14,7 @@ echo '{' while read atom do - echo ' { "'$atom'", &'$atom' },' + echo ' { "'$atom'", sizeof("'$atom'") - 1, &'$atom' },' done < $1 echo '};' diff --git a/common/atoms.c b/common/atoms.c index 47a9743f..b3760e7f 100644 --- a/common/atoms.c +++ b/common/atoms.c @@ -25,6 +25,7 @@ typedef struct { const char *name; + size_t len; xcb_atom_t *atom; } atom_item_t; @@ -42,7 +43,7 @@ atoms_init(xcb_connection_t *conn) for(i = 0; i < countof(ATOM_LIST); i++) cs[i] = xcb_intern_atom_unchecked(conn, false, - a_strlen(ATOM_LIST[i].name), + ATOM_LIST[i].len, ATOM_LIST[i].name); for(i = 0; i < countof(ATOM_LIST); i++)