From 78eeef4b49e50e377a7b7c1d4c7cfc579443ce6b Mon Sep 17 00:00:00 2001 From: kleink Date: Thu, 19 Oct 2000 09:47:43 +0000 Subject: [PATCH] Actually EINVAL fits the circumstances better. --- lib/libc/stdio/snprintf.c | 6 +++--- lib/libc/stdio/vsnprintf.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/libc/stdio/snprintf.c b/lib/libc/stdio/snprintf.c index e79bdb0f4f55..9a7ca858dc4e 100644 --- a/lib/libc/stdio/snprintf.c +++ b/lib/libc/stdio/snprintf.c @@ -1,4 +1,4 @@ -/* $NetBSD: snprintf.c,v 1.13 2000/10/19 09:45:31 kleink Exp $ */ +/* $NetBSD: snprintf.c,v 1.14 2000/10/19 09:47:43 kleink Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)snprintf.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: snprintf.c,v 1.13 2000/10/19 09:45:31 kleink Exp $"); +__RCSID("$NetBSD: snprintf.c,v 1.14 2000/10/19 09:47:43 kleink Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -79,7 +79,7 @@ snprintf(str, n, fmt, va_alist) _DIAGASSERT(fmt != NULL); if ((int)n < 0) { - errno = EOVERFLOW; + errno = EINVAL; return (-1); } #if __STDC__ diff --git a/lib/libc/stdio/vsnprintf.c b/lib/libc/stdio/vsnprintf.c index 02b763abc72f..1c70342fdbf1 100644 --- a/lib/libc/stdio/vsnprintf.c +++ b/lib/libc/stdio/vsnprintf.c @@ -1,4 +1,4 @@ -/* $NetBSD: vsnprintf.c,v 1.14 2000/10/19 09:45:31 kleink Exp $ */ +/* $NetBSD: vsnprintf.c,v 1.15 2000/10/19 09:47:43 kleink Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)vsnprintf.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: vsnprintf.c,v 1.14 2000/10/19 09:45:31 kleink Exp $"); +__RCSID("$NetBSD: vsnprintf.c,v 1.15 2000/10/19 09:47:43 kleink Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -69,7 +69,7 @@ vsnprintf(str, n, fmt, ap) _DIAGASSERT(fmt != NULL); if ((int)n < 0) { - errno = EOVERFLOW; + errno = EINVAL; return (-1); }