diff options
Diffstat (limited to 'libc/misc/time/asctime_r.c')
-rw-r--r-- | libc/misc/time/asctime_r.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/libc/misc/time/asctime_r.c b/libc/misc/time/asctime_r.c index 823ab4f4d..215031949 100644 --- a/libc/misc/time/asctime_r.c +++ b/libc/misc/time/asctime_r.c @@ -1,15 +1,16 @@ #include <time.h> +#include <errno.h> extern void __asctime(); -char *asctime_r(timeptr, buf) -__const struct tm *timeptr; -char *buf; +char *asctime_r(__const struct tm *timeptr, char *buf) { - - if (timeptr == 0) - return 0; - __asctime(buf, timeptr); - return buf; + if (timeptr == NULL || buf == NULL) { + __set_errno (EINVAL); + return NULL; + } + __asctime(buf, timeptr); + return buf; } + |