total = 0;
c = '\0';
b = buf + f->pos;
+ /* TODO: Could optimize here and only blank-out the remaining slots. */
memset(b, ' ', f->width);
while ((current = read(f->fd, &c, 1)) && c != '\n' && c != '\0' && total++ < f->width)
*b++ = c;
int
main(int argc, char *argv[])
{
- int width;
+ int width = 0;
int nfifos = 0;
- int seplen;
+ int seplen = 0;
int prefix = 0;
char *buf;
- Config *cfg = &defaults;
+ Config cfg0 = defaults;
+ Config *cfg = &cfg0;
Display *display = NULL;
argv0 = argv[0];
if (cfg->output_to_x_root_window && !(display = XOpenDisplay(NULL)))
fatal("XOpenDisplay failed with: %p\n", display);
/* TODO: nanosleep and nano time diff */
+ /* TODO: Handle signals */
for (;;) {
/* TODO: Check TTL and maybe blank-out */
/* TODO: How to trigger TTL check? On select? Alarm signal? */
fflush(stdout);
}
}
+
+ return EXIT_SUCCESS;
}