Page MenuHomePhabricator (Chris)

No OneTemporary

Authored By
Unknown
Size
865 B
Referenced Files
None
Subscribers
None
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

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)

Event Timeline