Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/date putenv() no longer accepts a const string



details:   https://anonhg.NetBSD.org/src/rev/49f8e86a1fd1
branches:  trunk
changeset: 757894:49f8e86a1fd1
user:      gson <gson%NetBSD.org@localhost>
date:      Sat Oct 02 08:26:09 2010 +0000

description:
putenv() no longer accepts a const string

diffstat:

 bin/date/date.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r 962928026355 -r 49f8e86a1fd1 bin/date/date.c
--- a/bin/date/date.c   Sat Oct 02 06:32:37 2010 +0000
+++ b/bin/date/date.c   Sat Oct 02 08:26:09 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: date.c,v 1.53 2010/05/29 20:41:58 dholland Exp $ */
+/* $NetBSD: date.c,v 1.54 2010/10/02 08:26:09 gson Exp $ */
 
 /*
  * Copyright (c) 1985, 1987, 1988, 1993
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "@(#)date.c     8.2 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: date.c,v 1.53 2010/05/29 20:41:58 dholland Exp $");
+__RCSID("$NetBSD: date.c,v 1.54 2010/10/02 08:26:09 gson Exp $");
 #endif
 #endif /* not lint */
 
@@ -79,6 +79,7 @@
        size_t bufsiz;
        const char *format;
        int ch;
+       static char tz_utc0[] = "TZ=UTC0";
 
        setprogname(argv[0]);
        (void)setlocale(LC_ALL, "");
@@ -106,7 +107,7 @@
                        tval = strtoll(optarg, NULL, 0);
                        break;
                case 'u':               /* do everything in UTC */
-                       (void)putenv("TZ=UTC0");
+                       (void)putenv(tz_utc0);
                        break;
                default:
                        usage();



Home | Main Index | Thread Index | Old Index