diff options
Diffstat (limited to 'src/w32.c')
| -rw-r--r-- | src/w32.c | 5 |
1 files changed, 4 insertions, 1 deletions
| @@ -5138,7 +5138,10 @@ fstatat (int fd, char const *name, struct stat *st, int flags) | |||
| 5138 | 5138 | ||
| 5139 | if (fd != AT_FDCWD) | 5139 | if (fd != AT_FDCWD) |
| 5140 | { | 5140 | { |
| 5141 | if (_snprintf (fullname, sizeof fullname, "%s/%s", dir_pathname, name) | 5141 | char lastc = dir_pathname[strlen (dir_pathname) - 1]; |
| 5142 | |||
| 5143 | if (_snprintf (fullname, sizeof fullname, "%s%s%s", | ||
| 5144 | dir_pathname, IS_DIRECTORY_SEP (lastc) ? "" : "/", name) | ||
| 5142 | < 0) | 5145 | < 0) |
| 5143 | { | 5146 | { |
| 5144 | errno = ENAMETOOLONG; | 5147 | errno = ENAMETOOLONG; |