fix off-by-one error that caused uninitialized memory read in floatscan
[musl] / src / string / strerror_r.c
1 #include <string.h>
2 #include <errno.h>
3
4 int strerror_r(int err, char *buf, size_t buflen)
5 {
6         char *msg = strerror(err);
7         if (strlen(msg) >= buflen)
8                 return ERANGE;
9         strcpy(buf, msg);
10         return 0;
11 }