summaryrefslogtreecommitdiffstats
path: root/5
diff options
context:
space:
mode:
authorSadeep Madurange <smadurange@users.noreply.github.com>2022-01-04 18:53:23 +0800
committerSadeep Madurange <smadurange@users.noreply.github.com>2022-01-04 18:53:23 +0800
commitfc1e8330d73b0c2f197a885ec736ed8f98572a7d (patch)
tree830a142024c4a5bc76688a6cd3f97d2c1a4b05d0 /5
parent92508d66648bbb3602cf1cac34d0faf422f32829 (diff)
downloadk&r-exercises-fc1e8330d73b0c2f197a885ec736ed8f98572a7d.tar.gz
5.8
Diffstat (limited to '5')
-rw-r--r--5/8.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/5/8.c b/5/8.c
index 9d376b1..5bcd213 100644
--- a/5/8.c
+++ b/5/8.c
@@ -37,13 +37,13 @@ void month_day(int year, int yearday, int *pmonth, int *pday) {
int i, leap;
if (year < 0) {
- *pmonth = *pday = 0;
+ *pmonth = *pday = -1;
printf("error: invalid year\n");
return;
}
if (yearday < 1) {
- *pmonth = *pday = 0;
+ *pmonth = *pday = -1;
printf("error: invalid yearday\n");
return;
}