misc.c (29452) | misc.c (42711) |
---|---|
1/* Copyright 1988,1990,1993,1994 by Paul Vixie 2 * All rights reserved 3 * 4 * Distribute freely, except: don't remove my name from the source or 5 * documentation (don't take credit for my work), mark your changes (don't 6 * get me blamed for your possible bugs), don't alter or remove this 7 * notice. May be sold if buildable source is provided to buyer. No 8 * warrantee of any kind, express or implied, is included with this 9 * software; use at your own risk, responsibility for damages (if any) to 10 * anyone resulting from the use of this software rests entirely with the 11 * user. 12 * 13 * Send bug reports, bug fixes, enhancements, requests, flames, etc., and 14 * I'll try to keep a version up to date. I can be reached as follows: 15 * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul 16 */ 17 18#if !defined(lint) && !defined(LINT) 19static const char rcsid[] = | 1/* Copyright 1988,1990,1993,1994 by Paul Vixie 2 * All rights reserved 3 * 4 * Distribute freely, except: don't remove my name from the source or 5 * documentation (don't take credit for my work), mark your changes (don't 6 * get me blamed for your possible bugs), don't alter or remove this 7 * notice. May be sold if buildable source is provided to buyer. No 8 * warrantee of any kind, express or implied, is included with this 9 * software; use at your own risk, responsibility for damages (if any) to 10 * anyone resulting from the use of this software rests entirely with the 11 * user. 12 * 13 * Send bug reports, bug fixes, enhancements, requests, flames, etc., and 14 * I'll try to keep a version up to date. I can be reached as follows: 15 * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul 16 */ 17 18#if !defined(lint) && !defined(LINT) 19static const char rcsid[] = |
20 "$Id: misc.c,v 1.5 1997/02/22 16:05:08 peter Exp $"; | 20 "$Id: misc.c,v 1.6 1997/09/15 06:39:25 charnier Exp $"; |
21#endif 22 23/* vix 26jan87 [RCS has the rest of the log] 24 * vix 30dec86 [written] 25 */ 26 27 28#include "cron.h" --- 585 unchanged lines hidden (view full) --- 614 * 123456789012345678901234567 615 */ 616char * 617arpadate(clock) 618 time_t *clock; 619{ 620 time_t t = clock ?*clock :time(0L); 621 struct tm *tm = localtime(&t); | 21#endif 22 23/* vix 26jan87 [RCS has the rest of the log] 24 * vix 30dec86 [written] 25 */ 26 27 28#include "cron.h" --- 585 unchanged lines hidden (view full) --- 614 * 123456789012345678901234567 615 */ 616char * 617arpadate(clock) 618 time_t *clock; 619{ 620 time_t t = clock ?*clock :time(0L); 621 struct tm *tm = localtime(&t); |
622 static char ret[30]; /* zone name might be >3 chars */ | 622 static char ret[32]; /* zone name might be >3 chars */ |
623 | 623 |
624 (void) sprintf(ret, "%s, %2d %s %2d %02d:%02d:%02d %s", | 624 if (tm->tm_year >= 100) 625 tm->tm_year += 1900; 626 627 (void) snprintf(ret, sizeof(ret), "%s, %2d %s %d %02d:%02d:%02d %s", |
625 DowNames[tm->tm_wday], 626 tm->tm_mday, 627 MonthNames[tm->tm_mon], 628 tm->tm_year, 629 tm->tm_hour, 630 tm->tm_min, 631 tm->tm_sec, 632 TZONE(*tm)); --- 13 unchanged lines hidden --- | 628 DowNames[tm->tm_wday], 629 tm->tm_mday, 630 MonthNames[tm->tm_mon], 631 tm->tm_year, 632 tm->tm_hour, 633 tm->tm_min, 634 tm->tm_sec, 635 TZONE(*tm)); --- 13 unchanged lines hidden --- |