sbase

suckless unix tools
git clone git://git.2f30.org/sbase
Log | Files | Refs | README | LICENSE

commit 83616df6fcede3fb7518af4dd0f93a8b1b3e44e2
parent c6f1e8aa20bc6f49b8d47b85c687d910c5b5ec2f
Author: Greg Reagle <greg.reagle@umbc.edu>
Date:   Tue,  6 Jan 2015 15:14:56 -0500

cal: Removed unused "day" variable

Diffstat:
Mcal.1 | 3+--
Mcal.c | 12++++--------
2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/cal.1 b/cal.1 @@ -14,8 +14,7 @@ cal \- print calendar .IR firstday ] .RB [ \-n .IR nmonths ] -.RB [ [ [ -.IR day ] +.RB [ [ .IR month ] .IR year ] .SH DESCRIPTION diff --git a/cal.c b/cal.c @@ -56,7 +56,7 @@ printgrid(int year, int month, int fday, int line) } static void -drawcal(int year, int month, int day, int ncols, int nmons, int fday) +drawcal(int year, int month, int ncols, int nmons, int fday) { char *smon[] = {" January", " February", " March", " April", " May", " June", " July", " August", @@ -103,14 +103,14 @@ static void usage(void) { eprintf("usage: %s [-1] [-3] [-m] [-s] [-y] [-c columns]" - " [-f firstday] [-n nmonths] [ [ [day] month] year]\n", + " [-f firstday] [-n nmonths] [ [month] year]\n", argv0); } int main(int argc, char *argv[]) { - int year, month, day, ncols, nmons, fday; + int year, month, ncols, nmons, fday; struct tm *ltime; time_t now; @@ -118,7 +118,6 @@ main(int argc, char *argv[]) ltime = localtime(&now); year = ltime->tm_year + 1900; month = ltime->tm_mon + 1; - day = ltime->tm_mday; fday = 0; ncols = 3; @@ -160,9 +159,6 @@ main(int argc, char *argv[]) } ARGEND; switch (argc) { - case 3: - day = estrtol(argv[0], 0); - argv++; case 2: month = estrtol(argv[0], 0); argv++; @@ -179,7 +175,7 @@ main(int argc, char *argv[]) usage(); } - drawcal(year, month-1, day, ncols, nmons, fday); + drawcal(year, month-1, ncols, nmons, fday); return 0; }