diff options
-rw-r--r-- | include/time.h | 3 | ||||
-rw-r--r-- | lib/libc/stdtime/strftime.3 | 2 | ||||
-rw-r--r-- | lib/libc/stdtime/strftime.c | 10 |
3 files changed, 7 insertions, 8 deletions
diff --git a/include/time.h b/include/time.h index e17feb3..daf8e90 100644 --- a/include/time.h +++ b/include/time.h @@ -121,7 +121,8 @@ double difftime(time_t, time_t); struct tm *gmtime(const time_t *); struct tm *localtime(const time_t *); time_t mktime(struct tm *); -size_t strftime(char *, size_t, const char *, const struct tm *); +size_t strftime(char *__restrict, size_t, const char *__restrict, + const struct tm *__restrict); time_t time(time_t *); #if __POSIX_VISIBLE diff --git a/lib/libc/stdtime/strftime.3 b/lib/libc/stdtime/strftime.3 index 172a6a6..6877775 100644 --- a/lib/libc/stdtime/strftime.3 +++ b/lib/libc/stdtime/strftime.3 @@ -47,7 +47,7 @@ .Sh SYNOPSIS .In time.h .Ft size_t -.Fn strftime "char *buf" "size_t maxsize" "const char *format" "const struct tm *timeptr" +.Fn strftime "char *restrict buf" "size_t maxsize" "const char *restrict format" "const struct tm *restrict timeptr" .Sh DESCRIPTION The .Fn strftime diff --git a/lib/libc/stdtime/strftime.c b/lib/libc/stdtime/strftime.c index bd3ba29..ab50bdc 100644 --- a/lib/libc/stdtime/strftime.c +++ b/lib/libc/stdtime/strftime.c @@ -44,16 +44,14 @@ static char * _add(const char *, char *, const char *); static char * _conv(int, const char *, char *, const char *); static char * _fmt(const char *, const struct tm *, char *, const char *); -size_t strftime(char *, size_t, const char *, const struct tm *); +size_t strftime(char *__restrict, size_t, const char *__restrict, + const struct tm *__restrict); extern char * tzname[]; size_t -strftime(s, maxsize, format, t) - char *const s; - const size_t maxsize; - const char *const format; - const struct tm *const t; +strftime(char *__restrict s, size_t maxsize, const char *__restrict format, + const struct tm *__restrict t) { char *p; |