By Philipp John - changed the application cal. It does not crash anymore, when the month and year parameter is invalid.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5175 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Phil Greenway
2003-10-27 03:56:12 +00:00
parent 922ec7f318
commit 0edb7e893f
+6 -2
View File
@@ -153,12 +153,16 @@ main(argc, argv)
year = 0;
switch(argc) {
case 2:
if ((month = atoi(*argv++)) < 1 || month > 12)
if ((month = atoi(*argv++)) < 1 || month > 12) {
(void)fprintf(stderr,"illegal month value: use 1-12\n");
exit(1);
}
/* FALLTHROUGH */
case 1:
if ((year = atoi(*argv)) < 1 || year > 9999)
if ((year = atoi(*argv)) < 1 || year > 9999) {
(void)fprintf(stderr,"illegal year value: use 1-9999\n");
exit(1);
}
break;
case 0:
(void)time(&now);