upstream: snprintf/vsnprintf return < 0 on error, rather than -1.

OpenBSD-Commit-ID: a261c421140a0639bb2b66bbceca72bf8239749d
This commit is contained in:
deraadt@openbsd.org 2019-07-03 03:24:02 +00:00 committed by Damien Miller
parent 4d28fa78ab
commit 8142fcaf9e
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: moduli.c,v 1.34 2019/01/23 09:49:00 dtucker Exp $ */
/* $OpenBSD: moduli.c,v 1.35 2019/07/03 03:24:02 deraadt Exp $ */
/*
* Copyright 1994 Phil Karn <karn@qualcomm.com>
* Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com>
@ -453,7 +453,7 @@ write_checkpoint(char *cpfile, u_int32_t lineno)
int r;
r = snprintf(tmp, sizeof(tmp), "%s.XXXXXXXXXX", cpfile);
if (r == -1 || r >= PATH_MAX) {
if (r < 0 || r >= PATH_MAX) {
logit("write_checkpoint: temp pathname too long");
return;
}