]> git.sur5r.net Git - i3/i3status/commitdiff
use printf instead of write to not mix two ways of outputting data
authorMichael Stapelberg <michael@stapelberg.de>
Sun, 25 Mar 2012 20:07:43 +0000 (22:07 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sun, 25 Mar 2012 20:07:43 +0000 (22:07 +0200)
Otherwise, the separator is not properly interleaved with output.

include/i3status.h

index 4ec0ce429807db0cd35dc1b11bd5e4b9405ee18e..43110548ff20f58a9acdea3131ae428f59c38d80 100644 (file)
@@ -61,7 +61,7 @@ enum { O_DZEN2, O_XMOBAR, O_I3BAR, O_NONE } output_format;
                        yajl_gen_string(json_gen, (const unsigned char *)"full_text", strlen("full_text")); \
                        yajl_gen_string(json_gen, (const unsigned char *)text, strlen(text)); \
                } else { \
                        yajl_gen_string(json_gen, (const unsigned char *)"full_text", strlen("full_text")); \
                        yajl_gen_string(json_gen, (const unsigned char *)text, strlen(text)); \
                } else { \
-                       write(STDOUT_FILENO, text, strlen(text)); \
+                       printf("%s", text); \
                } \
        } while (0)
 
                } \
        } while (0)