From 5d5b4c62d64ddf8723426d5bc18df93af01f3c64 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Fri, 3 Jun 2011 23:53:59 +0000 Subject: [PATCH] bug fixes --- main.c | 58 +++++++++++++++++++++++++++++----------------------------- util.c | 4 ++-- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/main.c b/main.c index ef8cec2..4235a96 100644 --- a/main.c +++ b/main.c @@ -79,35 +79,6 @@ dump(struct epg *epg __attribute__((unused)), tm = mjd(d->start_date, d->start_hour, d->start_min, d->start_sec); - printf("----------------------------------------------------------\n"); - - if (sysopts & SYSOPT_BRIEF) - { - safeprintf("%d/%d: %s+%d\n", - s->service_id, d->event_id, ctime_nl(&tm), - d->dur_hour * 3600 + d->dur_min * 60 + d->dur_sec); - if (ds[PARSER_SHORT_EVENT]) - { - struct descriptor *d77 = ds[PARSER_SHORT_EVENT]; - - safeprintf("Name:%.*s\n", - d77->content.d77.namelen, d77->content.d77.name); - safeprintf("Text:%.*s\n", - d77->content.d77.textlen, d77->content.d77.text); - } - - if (ds[PARSER_USER_DEFINED]) - { - struct descriptor *d137 = ds[PARSER_USER_DEFINED]; - - safeprintf("Warning:%.*s\n", - d137->content.d137.warninglen, - d137->content.d137.warning); - } - - return; - } - if (sysopts & SYSOPT_PARSABLE) { /* service_id, event_id, start, duration, encrypted, name, text @@ -159,6 +130,35 @@ dump(struct epg *epg __attribute__((unused)), return; } + printf("----------------------------------------------------------\n"); + + if (sysopts & SYSOPT_BRIEF) + { + safeprintf("%d/%d: %s+%d\n", + s->service_id, d->event_id, ctime_nl(&tm), + d->dur_hour * 3600 + d->dur_min * 60 + d->dur_sec); + if (ds[PARSER_SHORT_EVENT]) + { + struct descriptor *d77 = ds[PARSER_SHORT_EVENT]; + + safeprintf("Name:%.*s\n", + d77->content.d77.namelen, d77->content.d77.name); + safeprintf("Text:%.*s\n", + d77->content.d77.textlen, d77->content.d77.text); + } + + if (ds[PARSER_USER_DEFINED]) + { + struct descriptor *d137 = ds[PARSER_USER_DEFINED]; + + safeprintf("Warning:%.*s\n", + d137->content.d137.warninglen, + d137->content.d137.warning); + } + + return; + } + printf("%30s: %d\n", "Service ID", s->service_id); printf("%30s: %d\n", "Event ID", d->event_id); diff --git a/util.c b/util.c index 98f9e67..c777524 100644 --- a/util.c +++ b/util.c @@ -55,10 +55,10 @@ safeprintf(char *fmt, ...) va_end(argp); for (p = buf; p < buf + len; p++) - if (!isprint(*p)) + if (!isprint(*p) && *p != '\t') *p = '.'; - printf("%.*s\n", len, buf); + printf("%.*s", len, buf); } time_t