$OpenBSD: patch-insert_c,v 1.2 2003/11/04 23:31:05 fgsch Exp $ --- insert.c.orig 1996-06-27 02:03:31.000000000 -0300 +++ insert.c 2003-11-04 20:28:19.000000000 -0300 @@ -261,7 +261,6 @@ Widget w; time_t time_tp; struct tm *tm_tp; char dayname[12]; - char year[5]; char month[10]; /* get todays date and current time */ @@ -297,78 +296,78 @@ Widget w; case 10: sprintf(month, "Nov"); break; case 11: sprintf(month, "Dec"); break; } - if ( tm_tp->tm_year > 100 ) - sprintf(year,"20"); - else - sprintf(year,"19"); switch (active_item) { case 0: sprintf (cmd, - "%02d/%02d/%02d", tm_tp->tm_mon, tm_tp->tm_mday, tm_tp->tm_year ); + "%02d/%02d/%02d", tm_tp->tm_mon + 1, tm_tp->tm_mday, tm_tp->tm_year % 100); break; case 1: sprintf (cmd, - "<%02d/%02d/%02d>", tm_tp->tm_mon, tm_tp->tm_mday, tm_tp->tm_year ); + "<%02d/%02d/%02d>", tm_tp->tm_mon + 1, tm_tp->tm_mday, tm_tp->tm_year % 100); break; case 2: sprintf (cmd, - "(%02d/%02d/%02d)", tm_tp->tm_mon, tm_tp->tm_mday, tm_tp->tm_year ); + "(%02d/%02d/%02d)", tm_tp->tm_mon + 1, tm_tp->tm_mday, tm_tp->tm_year % 100); break; case 3: sprintf (cmd, "%02d/%02d/%02d - %02d:%02d", - tm_tp->tm_mon, tm_tp->tm_mday, tm_tp->tm_year, + tm_tp->tm_mon + 1, tm_tp->tm_mday, + tm_tp->tm_year % 100, tm_tp->tm_hour, tm_tp->tm_min ); break; case 4: sprintf (cmd, "%02d/%02d/%02d(%02d:%02d)", - tm_tp->tm_mon, tm_tp->tm_mday, tm_tp->tm_year, + tm_tp->tm_mon + 1, tm_tp->tm_mday, + tm_tp->tm_year % 100, tm_tp->tm_hour, tm_tp->tm_min ); break; case 5: sprintf (cmd, - "%s %d, %s%d", month, tm_tp->tm_mday, year, tm_tp->tm_year); + "%s %d, %d", month, tm_tp->tm_mday, tm_tp->tm_year + 1900); break; case 6: sprintf (cmd, - "%s %d, %s%d - %02d:%02d", - month, tm_tp->tm_mday, year, tm_tp->tm_year, + "%s %d, %d - %02d:%02d", + month, tm_tp->tm_mday, tm_tp->tm_year + 1900, tm_tp->tm_hour, tm_tp->tm_min ); break; case 7: sprintf (cmd, - "%s %d, %s%d (%02d:%02d)", - month, tm_tp->tm_mday, year, tm_tp->tm_year, + "%s %d, %d (%02d:%02d)", + month, tm_tp->tm_mday, tm_tp->tm_year + 1900, tm_tp->tm_hour, tm_tp->tm_min ); break; case 8: sprintf (cmd, - "%s %s %d, %s%d", - dayname, month, tm_tp->tm_mday, year, tm_tp->tm_year); + "%s %s %d, %d", + dayname, month, tm_tp->tm_mday, tm_tp->tm_year + 1900); break; case 9: sprintf (cmd, - "%s %s %d, %s%d - %02d:%02d", - dayname, month, tm_tp->tm_mday, year, tm_tp->tm_year, + "%s %s %d, %d - %02d:%02d", + dayname, month, tm_tp->tm_mday, + tm_tp->tm_year + 1900, tm_tp->tm_hour, tm_tp->tm_min ); break; case 10: sprintf (cmd, - "%s %s %d, %s%d (%02d:%02d)", - dayname, month, tm_tp->tm_mday, year, tm_tp->tm_year, + "%s %s %d, %d (%02d:%02d)", + dayname, month, tm_tp->tm_mday, + tm_tp->tm_year + 1900, tm_tp->tm_hour, tm_tp->tm_min ); break;