From owner-cvs-lib Wed Dec 24 06:36:42 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id GAA11112 for cvs-lib-outgoing; Wed, 24 Dec 1997 06:36:42 -0800 (PST) (envelope-from owner-cvs-lib) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id GAA11087; Wed, 24 Dec 1997 06:36:24 -0800 (PST) (envelope-from ache@FreeBSD.org) From: "Andrey A. Chernov" Received: (from ache@localhost) by freefall.freebsd.org (8.8.6/8.8.5) id GAA19823; Wed, 24 Dec 1997 06:32:42 -0800 (PST) Date: Wed, 24 Dec 1997 06:32:42 -0800 (PST) Message-Id: <199712241432.GAA19823@freefall.freebsd.org> To: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-lib@FreeBSD.ORG Subject: cvs commit: src/lib/libc/stdio snprintf.c vsnprintf.c Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk ache 1997/12/24 06:32:41 PST Modified files: lib/libc/stdio snprintf.c vsnprintf.c Log: Back out part related to "return 0 if n == 0" and return EOF as before. The main argument is that it is impossible to determine if %n evaluated or not when snprintf return 0, because it can happens for both n == 0 and n == 1. Although EOF here is good indication of the end of process, if n is decreased in the loop... Since it is already supposed in many places that EOF *is* negative, f.e. from Single Unix specs for snprintf "return ... a negative value if an output error was encountered" this not makes situation worse. Revision Changes Path 1.7 +1 -3 src/lib/libc/stdio/snprintf.c 1.7 +1 -3 src/lib/libc/stdio/vsnprintf.c