2

Your indentation has gone wrong here, and it's confusing: if (sl.equalsIgnoreCase("M")) { reliefDays = "SUN MON"; if (rdLength == 3) { reliefDays += " TUE"; } if (rdLength == 4) { reliefDays += " WED"; } ...


2

There's a serious problem here: gettimeofday(&curTime, NULL); ⋮ time(&rawtime); Suppose the system time is approximately HH:MM:00.999 when curTime is assigned, but a few microseconds later at HH:MM:01.000 when rawtime is assigned. This means that we'll print HH:MM:01.999, which is quite far from either value. Swapping the two calls won't help - ...


1

You can remove the necessity to use two buffers, and also they are too large (80? why?). The actual string will be something like 23 characters long. If you want to be cool and expect your program to last until end of 64bit unix timestamp, which is the year 292277026596, then we need 8 additional characters to fit. So 31 bytes for the actual characters in ...


Only top voted, non community-wiki answers of a minimum length are eligible