diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-06-18 10:53:58 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-06-18 10:53:58 +0000 |
commit | 28dbd78db68ddebbe43fda7d4abefd2d6257d286 (patch) | |
tree | b62ef5f6c371aced00114a58b7dac6bc1feb4498 /man_action.c | |
parent | ebc04fb0a062bcf881ac1fbe0706af873a8fcfc8 (diff) | |
download | mandoc-28dbd78db68ddebbe43fda7d4abefd2d6257d286.tar.gz |
Moved all formatted libman warn/error into man.c/libman.h.
Converted all formatted warn/errors into regular syntax.
Diffstat (limited to 'man_action.c')
-rw-r--r-- | man_action.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/man_action.c b/man_action.c index 3d8d784a..1bb775f3 100644 --- a/man_action.c +++ b/man_action.c @@ -108,8 +108,7 @@ post_TH(struct man *m) assert(n); if (NULL == (m->meta.title = strdup(n->string))) - return(man_verr(m, n->line, n->pos, - "memory exhausted")); + return(man_nerr(m, n, WNMEM)); /* TITLE ->MSEC<- DATE SOURCE VOL */ @@ -120,7 +119,7 @@ post_TH(struct man *m) lval = strtol(n->string, &ep, 10); if (n->string[0] != '\0' && *ep == '\0') m->meta.msec = (int)lval; - else if ( ! man_vwarn(m, n->line, n->pos, "invalid section")) + else if ( ! man_nwarn(m, n, WMSEC)) return(0); /* TITLE MSEC ->DATE<- SOURCE VOL */ @@ -128,7 +127,7 @@ post_TH(struct man *m) if (NULL == (n = n->next)) m->meta.date = time(NULL); else if (0 == (m->meta.date = man_atotime(n->string))) { - if ( ! man_vwarn(m, n->line, n->pos, "invalid date")) + if ( ! man_nwarn(m, n, WDATE)) return(0); m->meta.date = time(NULL); } @@ -137,15 +136,13 @@ post_TH(struct man *m) if (n && (n = n->next)) if (NULL == (m->meta.source = strdup(n->string))) - return(man_verr(m, n->line, n->pos, - "memory exhausted")); + return(man_nerr(m, n, WNMEM)); /* TITLE MSEC DATE SOURCE ->VOL<- */ if (n && (n = n->next)) if (NULL == (m->meta.vol = strdup(n->string))) - return(man_verr(m, n->line, n->pos, - "memory exhausted")); + return(man_nerr(m, n, WNMEM)); /* * The end document shouldn't have the prologue macros as part @@ -178,7 +175,7 @@ man_atotime(const char *p) struct tm tm; char *pp; - (void)memset(&tm, 0, sizeof(struct tm)); + bzero(&tm, sizeof(struct tm)); if ((pp = strptime(p, "%b %d %Y", &tm)) && 0 == *pp) return(mktime(&tm)); |