bug fixes

This commit is contained in:
hummypkg 2011-06-03 23:53:59 +00:00 committed by HummyPkg
parent 992e0114aa
commit 5d5b4c62d6
2 changed files with 31 additions and 31 deletions

58
main.c
View File

@ -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);

4
util.c
View File

@ -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