Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F134215
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
865 B
Referenced Files
None
Subscribers
None
View Options
diff --git a/calendar.cpp b/calendar.cpp
index ae06e10..2622379 100644
--- a/calendar.cpp
+++ b/calendar.cpp
@@ -1,16 +1,23 @@
#include "calendar.h"
std::string getHoliday(int month, int day)
{
for (int i=0;i<59;i++)
{
- if (month==std::stoi(PAGAN_HOLIDAYS[i][0]))
+ try
{
- if (day==std::stoi(PAGAN_HOLIDAYS[i][1]))
+ if (month==std::stoi(PAGAN_HOLIDAYS[i][0]))
{
- return PAGAN_HOLIDAYS[i][2];
+ if (day==std::stoi(PAGAN_HOLIDAYS[i][1]))
+ {
+ return PAGAN_HOLIDAYS[i][2];
+ }
}
+ } catch (...)
+ {
+ std::cerr << "Failed to convert " << PAGAN_HOLIDAYS[i][0] << " and " << PAGAN_HOLIDAYS[i][1] << " into ints\n";
+ continue;
}
}
return "";
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Wed, Jun 17, 9:22 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
70768
Default Alt Text
(865 B)
Attached To
Mode
R82 deerportal
Attached
Detach File
Event Timeline