X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=x5%2Fkhatus.c;h=293b346362268b14d51a82fd9a8dd0bb23e6d953;hb=45f1ce6e2dbaedd30f0ceed2d8f3feb4afa157a6;hp=c5da07333549457d7817f6eca9037a467c939430;hpb=a6d4c9c3b8d4dc85415c572e2182ce0225962f83;p=khatus.git diff --git a/x5/khatus.c b/x5/khatus.c index c5da073..293b346 100644 --- a/x5/khatus.c +++ b/x5/khatus.c @@ -255,6 +255,7 @@ read_one(Fifo *f, char *buf) 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; @@ -308,9 +309,9 @@ read_all(Config *cfg, char *buf) 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 cfg0 = defaults; @@ -351,6 +352,7 @@ main(int argc, char *argv[]) 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? */