How would one subtract a day from struct tm at athe same time ensuring the new date is valid.
For example,
struct tm time = {};
time.tm_year = year - 1900;
time.tm_mon = month - 1;
time.tm_mday = day;
with day = 1, month = 9, and year = 2014.
So, if I now subtract a day time.tm_mday = 0, which is invalid.
But I can't just set the tm_mday to 31 and reduce the month by 1 as I don't know how many days are there in the previous month in a runtime scenario.