Mercurial > hg > toybox
changeset 1310:7baa19cdce59 draft
Remove debug detritus I didn't mean to to check in, and treat an "this variable can never actually be used uninitialized but gcc's warning generator can't tell and fails spamwards" warning.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 24 May 2014 12:51:53 -0500 |
parents | ad7d75f97029 |
children | 726d3e67d8c1 |
files | toys/posix/date.c |
diffstat | 1 files changed, 2 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/toys/posix/date.c Sat May 24 12:49:21 2014 -0500 +++ b/toys/posix/date.c Sat May 24 12:51:53 2014 -0500 @@ -95,13 +95,13 @@ void date_main(void) { char *setdate = *toys.optargs, *format_string = "%a %b %e %H:%M:%S %Z %Y", - *tz; + *tz = 0; time_t now = time(NULL); struct tm tm; // We can't just pass a timezone to mktime because posix. if (toys.optflags & FLAG_u) { - tz = CFG_TOYBOX_FREE ? getenv("TZ") : 0; + if (CFG_TOYBOX_FREE) tz = getenv("TZ"); setenv("TZ", "UTC", 1); tzset(); } @@ -114,7 +114,6 @@ } else if (TT.showdate) { setdate = TT.showdate; if (TT.setfmt) { -printf("TT.showdate=%s TT.setfmt=%s\n", TT.showdate, TT.setfmt); char *s = strptime(TT.showdate, TT.setfmt+(*TT.setfmt=='+'), &tm); if (!s || *s) goto bad_date;