summaryrefslogtreecommitdiffstats
path: root/bin/date/date.c
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1995-04-03 20:08:33 +0000
committerjoerg <joerg@FreeBSD.org>1995-04-03 20:08:33 +0000
commit1fa4f508ae06734eb3ae304082ac664cf1c0a417 (patch)
tree852cdcf096e63d859cef531654b6fa57e7cf02d3 /bin/date/date.c
parent20dc61c2a12023f44a6877f3b4cb62cd91862251 (diff)
downloadFreeBSD-src-1fa4f508ae06734eb3ae304082ac664cf1c0a417.zip
FreeBSD-src-1fa4f508ae06734eb3ae304082ac664cf1c0a417.tar.gz
date(1) didn't emit a final newline if the format had been specified
with `+'. This breaks tradition and violates Posix 1003.2. Discoverd by: luigi@labinfo.iet.unipi.it (Luigi Rizzo)
Diffstat (limited to 'bin/date/date.c')
-rw-r--r--bin/date/date.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/date/date.c b/bin/date/date.c
index 1098046..408c621 100644
--- a/bin/date/date.c
+++ b/bin/date/date.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: date.c,v 1.2 1994/09/24 02:54:36 davidg Exp $
+ * $Id: date.c,v 1.3 1994/12/26 12:59:28 bde Exp $
*/
#ifndef lint
@@ -123,7 +123,7 @@ main(argc, argv)
if (!rflag && time(&tval) == -1)
err(1, "time");
- format = "%a %b %e %H:%M:%S %Z %Y\n";
+ format = "%a %b %e %H:%M:%S %Z %Y";
/* allow the operands in any order */
if (*argv && **argv == '+') {
@@ -140,7 +140,7 @@ main(argc, argv)
format = *argv + 1;
(void)strftime(buf, sizeof(buf), format, localtime(&tval));
- (void)printf("%s", buf);
+ (void)printf("%s\n", buf);
exit(retval);
}
OpenPOWER on IntegriCloud