=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mandoc.c,v retrieving revision 1.83 retrieving revision 1.84 diff -c -r1.83 -r1.84 *** src/usr.bin/mandoc/mandoc.c 2019/05/21 08:03:43 1.83 --- src/usr.bin/mandoc/mandoc.c 2019/06/27 15:05:14 1.84 *************** *** 1,4 **** ! /* $OpenBSD: mandoc.c,v 1.83 2019/05/21 08:03:43 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2011-2015, 2017, 2018 Ingo Schwarze --- 1,4 ---- ! /* $OpenBSD: mandoc.c,v 1.84 2019/06/27 15:05:14 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2011-2015, 2017, 2018 Ingo Schwarze *************** *** 489,497 **** size_t ssz; int isz; tm = localtime(&t); if (tm == NULL) ! return NULL; /* * Reserve space: --- 489,498 ---- size_t ssz; int isz; + buf = NULL; tm = localtime(&t); if (tm == NULL) ! goto fail; /* * Reserve space: *************** *** 515,521 **** * of looking at LC_TIME. */ ! if ((isz = snprintf(p, 4 + 1, "%d, ", tm->tm_mday)) == -1) goto fail; p += isz; --- 516,523 ---- * of looking at LC_TIME. */ ! isz = snprintf(p, 4 + 1, "%d, ", tm->tm_mday); ! if (isz < 0 || isz > 4) goto fail; p += isz; *************** *** 525,531 **** fail: free(buf); ! return NULL; } char * --- 527,533 ---- fail: free(buf); ! return mandoc_strdup(""); } char * *************** *** 533,538 **** --- 535,543 ---- { char *cp; time_t t; + + if (man->quick) + return mandoc_strdup(in == NULL ? "" : in); /* No date specified: use today's date. */