summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bench/atom.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bench/atom.c b/bench/atom.c
index 7d78f64..e4c290b 100644
--- a/bench/atom.c
+++ b/bench/atom.c
@@ -47,6 +47,7 @@ main(void)
const char *text;
struct bench bench;
char *elapsed;
+ size_t word_len;
darray_init(words);
file = fopen("/usr/share/dict/words", "rb");
@@ -68,7 +69,8 @@ main(void)
assert(table);
darray_foreach(worditer, words) {
- atom = atom_intern(table, *worditer, strlen(*worditer) - 1, true);
+ word_len = strlen(*worditer) > 0 ? strlen(*worditer) - 1 : 0;
+ atom = atom_intern(table, *worditer, word_len, true);
assert(atom != XKB_ATOM_NONE);
text = atom_text(table, atom);