From owner-cvs-usrbin Fri Mar 7 04:34:55 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id EAA08332 for cvs-usrbin-outgoing; Fri, 7 Mar 1997 04:34:55 -0800 (PST) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id EAA08312; Fri, 7 Mar 1997 04:34:20 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.3/8.6.9) id XAA14372; Fri, 7 Mar 1997 23:29:13 +1100 Date: Fri, 7 Mar 1997 23:29:13 +1100 From: Bruce Evans Message-Id: <199703071229.XAA14372@godzilla.zeta.org.au> To: cvs-all@freefall.freebsd.org, CVS-committers@freefall.freebsd.org, cvs-usrbin@freefall.freebsd.org, yokota@freefall.freebsd.org Subject: Re: cvs commit: src/usr.bin/w pr_time.c w.c Sender: owner-cvs-usrbin@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > Modified: usr.bin/w pr_time.c w.c > Log: > Made sure the string formated by strftime() is properly > null-terminated. Strings are null-terminated by definition. According to the ANSI C standard, strftime() gives either a string (if there is enough space) or indeterminate buffer contents (otherwise) according to the ANSI C standard. The FreeBSD behaviour of truncating the string should not be documented or depended on. This means that the result of strftime() should always be checked. A fixed-size buffer may be too small because the locale has long time-related strings. Bruce