diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-09 19:10:49 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-09 19:10:49 +0100 |
commit | dc698bb038756a926aaa529bda1b939eab2c1676 (patch) | |
tree | 4084a40897d9d81816228935a1398e80dd4b173b /coreutils/cal.c | |
parent | 0681137972dc89b5003b0415e09184c0ecf1c875 (diff) | |
download | busybox-w32-dc698bb038756a926aaa529bda1b939eab2c1676.tar.gz busybox-w32-dc698bb038756a926aaa529bda1b939eab2c1676.tar.bz2 busybox-w32-dc698bb038756a926aaa529bda1b939eab2c1676.zip |
*: make it easier to distinquish "struct tm", pointer to one, etc
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils/cal.c')
-rw-r--r-- | coreutils/cal.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/coreutils/cal.c b/coreutils/cal.c index 823644226..e6f9af937 100644 --- a/coreutils/cal.c +++ b/coreutils/cal.c | |||
@@ -79,7 +79,6 @@ static char *build_row(char *p, unsigned *dp); | |||
79 | int cal_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 79 | int cal_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
80 | int cal_main(int argc UNUSED_PARAM, char **argv) | 80 | int cal_main(int argc UNUSED_PARAM, char **argv) |
81 | { | 81 | { |
82 | struct tm *local_time; | ||
83 | struct tm zero_tm; | 82 | struct tm zero_tm; |
84 | time_t now; | 83 | time_t now; |
85 | unsigned month, year, flags, i; | 84 | unsigned month, year, flags, i; |
@@ -94,11 +93,13 @@ int cal_main(int argc UNUSED_PARAM, char **argv) | |||
94 | argv += optind; | 93 | argv += optind; |
95 | 94 | ||
96 | if (!argv[0]) { | 95 | if (!argv[0]) { |
96 | struct tm *ptm; | ||
97 | |||
97 | time(&now); | 98 | time(&now); |
98 | local_time = localtime(&now); | 99 | ptm = localtime(&now); |
99 | year = local_time->tm_year + 1900; | 100 | year = ptm->tm_year + 1900; |
100 | if (!(flags & 2)) { /* no -y */ | 101 | if (!(flags & 2)) { /* no -y */ |
101 | month = local_time->tm_mon + 1; | 102 | month = ptm->tm_mon + 1; |
102 | } | 103 | } |
103 | } else { | 104 | } else { |
104 | if (argv[1]) { | 105 | if (argv[1]) { |