* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
#ifndef lint
static const char rcsid[] =
- "$Id: itime.c,v 1.23 2002/08/01 10:23:26 stelian Exp $";
+ "$Id: itime.c,v 1.25 2003/03/30 15:40:36 stelian Exp $";
#endif /* not lint */
#include <config.h>
static void
dumprecout(FILE *file, struct dumpdates *what)
{
+ char buf[26];
+ struct tm *tms;
- if (fprintf(file, "%s %c %s",
+ tms = localtime(&what->dd_ddate);
+ strncpy(buf, asctime(tms), sizeof(buf));
+ if (buf[24] != '\n' || buf[25] != '\0')
+ quit("asctime returned an unexpected string\n");
+ buf[24] = 0;
+ if (fprintf(file, "%s %c %s %c%2.2d%2.2d\n",
what->dd_name,
what->dd_level,
- ctime(&what->dd_ddate)) < 0)
+ buf,
+ (tms->tm_gmtoff < 0 ? '-' : '+'),
+ abs(tms->tm_gmtoff) / 3600,
+ abs(tms->tm_gmtoff) % 3600 / 60) < 0)
quit("%s: %s\n", dumpdates, strerror(errno));
}