summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xlsatoms.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/xlsatoms.c b/xlsatoms.c
index 2bb5b47..5bed0cc 100644
--- a/xlsatoms.c
+++ b/xlsatoms.c
@@ -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) {