* $Id$
*/
+#include "h/mh.h" /* for snprintf() */
#include <h/nmh.h>
#include <tws.h>
char *
dctime (struct tws *tw)
{
- static char buffer[25];
+ static char buffer[26];
if (!tw)
return NULL;
tw->tw_wday =
((26 * month - 2) / 10 + day + year + year / 4
- 3 * century / 4 + 1) % 7;
+ if (tw->tw_wday < 0)
+ tw->tw_wday += 7;
tw->tw_flags &= ~TW_SDAY, tw->tw_flags |= TW_SIMP;
}