diff options
author | Sergey Bugaev <bugaevc@gmail.com> | 2021-04-27 18:43:22 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2021-04-27 18:44:17 +0200 |
commit | f5de3da2f8882bc8477ebbed106ed3f70f54544a (patch) | |
tree | 65f66be310926b5bdd11371dac20de30fb43fbca | |
parent | 1f632b841d9b1b5f6274c0e06232172890247fed (diff) |
This fixes Wstringop-overflow and Wstringop-truncation GCC warnings.
See https://gcc.gnu.org/bugzilla//show_bug.cgi?id=88059
-rw-r--r-- | lib.c | 4 | ||||
-rw-r--r-- | stow.c | 2 |
2 files changed, 3 insertions, 3 deletions
@@ -151,8 +151,8 @@ make_filepath (char *path, char *filename) if (filepath == NULL) return NULL; - strncpy (filepath, path, length); - strncat (filepath, filename, strlen (filename)); + strcpy (filepath, path); + strcat (filepath, filename); return filepath; } @@ -287,7 +287,7 @@ stow_diradd (char *dir, int flags, struct patternlist *patternlist, if (tmp == NULL) return ENOMEM; - strncpy (tmp, dir, dir_len); + strcpy (tmp, dir); tmp[dir_len] = '/'; tmp[dir_len + 1] = 0; |