diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 12:49:45 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 12:49:45 +0300 |
commit | 6607eb3d5e40b98d2acc8f6b0d6a0b5a4b0f56bd (patch) | |
tree | c1eb39be8cc5c19101385e171ec0c58f95d521cc /missing/strftime.c | |
parent | 6719bb6e1c5576e857ab6fc121ec31a75161a3e7 (diff) | |
download | egawk-6607eb3d5e40b98d2acc8f6b0d6a0b5a4b0f56bd.tar.gz egawk-6607eb3d5e40b98d2acc8f6b0d6a0b5a4b0f56bd.tar.bz2 egawk-6607eb3d5e40b98d2acc8f6b0d6a0b5a4b0f56bd.zip |
Move to gawk-3.0.3.
Diffstat (limited to 'missing/strftime.c')
-rw-r--r-- | missing/strftime.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/missing/strftime.c b/missing/strftime.c index 1e16868c..18a6a7bf 100644 --- a/missing/strftime.c +++ b/missing/strftime.c @@ -92,23 +92,25 @@ #ifndef __STDC__ #define const /**/ -extern void *malloc(); -extern void *realloc(); extern void tzset(); -extern char *strchr(); -extern char *getenv(); static int weeknumber(); adddecl(static int iso8601wknum();) #else -extern void *malloc(unsigned count); -extern void *realloc(void *ptr, unsigned count); extern void tzset(void); -extern char *strchr(const char *str, int ch); -extern char *getenv(const char *v); static int weeknumber(const struct tm *timeptr, int firstweekday); adddecl(static int iso8601wknum(const struct tm *timeptr);) #endif +#ifdef STDC_HEADERS +#include <stdlib.h> +#include <string.h> +#else +extern void *malloc(); +extern void *realloc(); +extern char *getenv(); +extern char *strchr(); +#endif + #ifdef __GNUC__ #define inline __inline__ #else @@ -504,7 +506,7 @@ strftime(char *s, size_t maxsize, const char *format, const struct tm *timeptr) #ifdef VMS_EXT case 'v': /* date as dd-bbb-YYYY */ - sprintf(tbuf, "%02d-%3.3s-%4d", + sprintf(tbuf, "%2d-%3.3s-%4d", range(1, timeptr->tm_mday, 31), months_a[range(0, timeptr->tm_mon, 11)], timeptr->tm_year + 1900); |