From 24b82772d268dc8933f481d605cdc98321111616 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sat, 18 Apr 2009 13:37:01 +0200 Subject: [PATCH] atoms: drop useless strlen usage Signed-off-by: Julien Danjou --- build-utils/atoms-int.sh | 2 +- common/atoms.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build-utils/atoms-int.sh b/build-utils/atoms-int.sh index dde2fe9f3..5f8f127f5 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 47a9743f8..b3760e7f8 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++)