diff --git a/bin/xbps-pkgdb/check_pkg_symlinks.c b/bin/xbps-pkgdb/check_pkg_symlinks.c index 1394e390..a7c1fe8b 100644 --- a/bin/xbps-pkgdb/check_pkg_symlinks.c +++ b/bin/xbps-pkgdb/check_pkg_symlinks.c @@ -106,10 +106,10 @@ check_pkg_symlinks(struct xbps_handle *xhp, const char *pkgname, void *arg) snprintf(path, sizeof(path), "%s%s", xhp->rootdir, file); snprintf(tgt_path, sizeof(tgt_path), "%s%s", xhp->rootdir, tgt); - strncpy(tgt_path, tgt, sizeof(tgt_path)); + strncpy(tgt_path, tgt, sizeof(tgt_path)-1); } else { - strncpy(path, file, sizeof(path)); - strncpy(tgt_path, tgt, sizeof(tgt_path)); + strncpy(path, file, sizeof(path)-1); + strncpy(tgt_path, tgt, sizeof(tgt_path)-1); } if ((lnk = symlink_target(pkgname, path)) == NULL)