From f8d9ff23eb8d3e3286ff5cf4d5f9493532991bb7 Mon Sep 17 00:00:00 2001 From: zlg Date: Thu, 16 Jun 2016 10:15:33 -0700 Subject: The massive astyle sweep! Code style should be consistent now. All future commits will be run through astyle or they will be amended. --- ch5/5-08_error-checking.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'ch5/5-08_error-checking.c') diff --git a/ch5/5-08_error-checking.c b/ch5/5-08_error-checking.c index 61c15c7..b1bc5e7 100644 --- a/ch5/5-08_error-checking.c +++ b/ch5/5-08_error-checking.c @@ -19,7 +19,6 @@ int main() { int m, d, doy; m = d = 0; doy = 0; - printf("Calling day_of_year(1973, 10, 32)\n> "); if ((doy = day_of_year(1973, 10, 32)) > 0) { printf("Oct 12nd, 1973 is day %d\n", doy); @@ -52,7 +51,6 @@ int main() { int day_of_year(int year, int month, int day) { int i, leap; leap = (year % 4 == 0 && year % 100 != 0) || year % 400 == 0; - if (month < 1 || month > 12) { return -1; } @@ -68,7 +66,6 @@ int day_of_year(int year, int month, int day) { void month_day(int year, int yearday, int *pmonth, int *pday) { int i, leap; leap = (year % 4 == 0 && year % 100 != 0) || year % 400 == 0; - // Check for edge case if (yearday > 365 + leap || yearday < 1) { *pmonth = 0; // Set to zero so the error is obvious -- cgit v1.2.3-54-g00ecf