diff options
-rw-r--r-- | xlsatoms.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -248,13 +248,15 @@ say_batch(xcb_connection_t *c, const char *format, xcb_get_atom_name_cookie_t *c xcb_get_atom_name_reply_t *r; r = xcb_get_atom_name_reply(c, cookie[i], &e); if (r) { - /* We could just use %.*s in 'format', but we want to be compatible - with legacy command line usage */ - snprintf(atom_name, sizeof(atom_name), "%.*s", - r->name_len, xcb_get_atom_name_name(r)); - - printf (format, i + low, atom_name); - putchar ('\n'); + if (!done) { + /* We could just use %.*s in 'format', but we want to be compatible + with legacy command line usage */ + snprintf(atom_name, sizeof(atom_name), "%.*s", + r->name_len, xcb_get_atom_name_name(r)); + + printf (format, i + low, atom_name); + putchar ('\n'); + } free(r); } if (e) { |