summaryrefslogtreecommitdiffstats
path: root/mandoc.c
diff options
context:
space:
mode:
Diffstat (limited to 'mandoc.c')
-rw-r--r--mandoc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/mandoc.c b/mandoc.c
index 434d5d93..46cedc67 100644
--- a/mandoc.c
+++ b/mandoc.c
@@ -494,9 +494,10 @@ time2a(time_t t)
size_t ssz;
int isz;
+ buf = NULL;
tm = localtime(&t);
if (tm == NULL)
- return NULL;
+ goto fail;
/*
* Reserve space:
@@ -520,7 +521,8 @@ time2a(time_t t)
* of looking at LC_TIME.
*/
- if ((isz = snprintf(p, 4 + 1, "%d, ", tm->tm_mday)) == -1)
+ isz = snprintf(p, 4 + 1, "%d, ", tm->tm_mday);
+ if (isz < 0 || isz > 4)
goto fail;
p += isz;
@@ -530,7 +532,7 @@ time2a(time_t t)
fail:
free(buf);
- return NULL;
+ return mandoc_strdup("");
}
char *
@@ -539,6 +541,9 @@ mandoc_normdate(struct roff_man *man, char *in, int ln, int pos)
char *cp;
time_t t;
+ if (man->quick)
+ return mandoc_strdup(in == NULL ? "" : in);
+
/* No date specified: use today's date. */
if (in == NULL || *in == '\0')