Fix some warnings from newer compilers

This commit is contained in:
Justin Maggard
2020-09-25 17:48:07 -07:00
committed by Justin Maggard
parent 9fba41008a
commit 9f1677825c
10 changed files with 35 additions and 22 deletions

View File

@@ -53,8 +53,8 @@ strcatf(struct string_s *str, const char *fmt, ...)
}
static inline void strncpyt(char *dst, const char *src, size_t len)
{
strncpy(dst, src, len);
dst[len-1] = '\0';
strncpy(dst, src, --len);
dst[len] = '\0';
}
static inline int is_reg(const struct dirent *d)
{