X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubox.git;a=blobdiff_plain;f=log%2Fsyslog.c;h=856fa60edce459f7cf525384b9d128dbdc8218ad;hp=a596b487af4c46458424b5478917857da8fb686f;hb=16f7e16181e2f3e9cf3e2ce56a7e291844900d09;hpb=7ef8dda5115d8a2c1157c0438af710c555f40b32 diff --git a/log/syslog.c b/log/syslog.c index a596b48..856fa60 100644 --- a/log/syslog.c +++ b/log/syslog.c @@ -51,7 +51,7 @@ static regex_t pat_tstamp; static struct log_head* log_next(struct log_head *h, int size) { - struct log_head *n = (struct log_head *) &h->data[PAD(sizeof(struct log_head) + size)]; + struct log_head *n = (struct log_head *) &h->data[PAD(size)]; return (n >= log_end) ? (log) : (n); } @@ -66,7 +66,7 @@ log_add(char *buf, int size, int source) /* bounce out if we don't have init'ed yet (regmatch etc will blow) */ if (!log) { - fprintf(stderr, buf); + fprintf(stderr, "%s", buf); return; } @@ -300,4 +300,6 @@ log_shutdown(void) close(slog.fd.fd); close(klog.fd.fd); free(log); + regfree(&pat_prio); + regfree(&pat_tstamp); }