diff options
Diffstat (limited to 'moduli.c')
-rw-r--r-- | moduli.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: moduli.c,v 1.34 2019/01/23 09:49:00 dtucker Exp $ */ | 1 | /* $OpenBSD: moduli.c,v 1.36 2019/10/04 03:26:58 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright 1994 Phil Karn <karn@qualcomm.com> | 3 | * Copyright 1994 Phil Karn <karn@qualcomm.com> |
4 | * Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com> | 4 | * Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com> |
@@ -159,6 +159,8 @@ qfileout(FILE * ofile, u_int32_t otype, u_int32_t otests, u_int32_t otries, | |||
159 | 159 | ||
160 | time(&time_now); | 160 | time(&time_now); |
161 | gtm = gmtime(&time_now); | 161 | gtm = gmtime(&time_now); |
162 | if (gtm == NULL) | ||
163 | return -1; | ||
162 | 164 | ||
163 | res = fprintf(ofile, "%04d%02d%02d%02d%02d%02d %u %u %u %u %x ", | 165 | res = fprintf(ofile, "%04d%02d%02d%02d%02d%02d %u %u %u %u %x ", |
164 | gtm->tm_year + 1900, gtm->tm_mon + 1, gtm->tm_mday, | 166 | gtm->tm_year + 1900, gtm->tm_mon + 1, gtm->tm_mday, |
@@ -453,7 +455,7 @@ write_checkpoint(char *cpfile, u_int32_t lineno) | |||
453 | int r; | 455 | int r; |
454 | 456 | ||
455 | r = snprintf(tmp, sizeof(tmp), "%s.XXXXXXXXXX", cpfile); | 457 | r = snprintf(tmp, sizeof(tmp), "%s.XXXXXXXXXX", cpfile); |
456 | if (r == -1 || r >= PATH_MAX) { | 458 | if (r < 0 || r >= PATH_MAX) { |
457 | logit("write_checkpoint: temp pathname too long"); | 459 | logit("write_checkpoint: temp pathname too long"); |
458 | return; | 460 | return; |
459 | } | 461 | } |