summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@acm.org>2016-01-31 12:24:45 -0800
committerTim Kientzle <kientzle@acm.org>2016-01-31 12:24:45 -0800
commit86adcf859bcf90c5026ed5e60d685299ac130995 (patch)
treeaf5cfb9967e9509473f246c88300f5e44c3c1f9d
parentf2ac501a99d2e5a7d0488c911dde41f91c2ecdf0 (diff)
downloadlibarchive-86adcf859bcf90c5026ed5e60d685299ac130995.tar.gz
Bring along a trailing null when guessing the path to the program under test
-rw-r--r--cat/test/main.c2
-rw-r--r--cpio/test/main.c2
-rw-r--r--libarchive/test/main.c2
-rw-r--r--tar/test/main.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/cat/test/main.c b/cat/test/main.c
index 54a7d01e..8c414da1 100644
--- a/cat/test/main.c
+++ b/cat/test/main.c
@@ -2659,7 +2659,7 @@ main(int argc, char **argv)
exit(1);
}
memmove(testprogdir + strlen(pwd) + 1, testprogdir,
- strlen(testprogdir));
+ strlen(testprogdir) + 1);
memcpy(testprogdir, pwd, strlen(pwd));
testprogdir[strlen(pwd)] = '/';
}
diff --git a/cpio/test/main.c b/cpio/test/main.c
index b10ab1e4..58011274 100644
--- a/cpio/test/main.c
+++ b/cpio/test/main.c
@@ -2660,7 +2660,7 @@ main(int argc, char **argv)
exit(1);
}
memmove(testprogdir + strlen(pwd) + 1, testprogdir,
- strlen(testprogdir));
+ strlen(testprogdir) + 1);
memcpy(testprogdir, pwd, strlen(pwd));
testprogdir[strlen(pwd)] = '/';
}
diff --git a/libarchive/test/main.c b/libarchive/test/main.c
index 3cd8766b..b39c2bf7 100644
--- a/libarchive/test/main.c
+++ b/libarchive/test/main.c
@@ -2658,7 +2658,7 @@ main(int argc, char **argv)
exit(1);
}
memmove(testprogdir + strlen(pwd) + 1, testprogdir,
- strlen(testprogdir));
+ strlen(testprogdir) + 1);
memcpy(testprogdir, pwd, strlen(pwd));
testprogdir[strlen(pwd)] = '/';
}
diff --git a/tar/test/main.c b/tar/test/main.c
index d60a9dca..33a6364b 100644
--- a/tar/test/main.c
+++ b/tar/test/main.c
@@ -2660,7 +2660,7 @@ main(int argc, char **argv)
exit(1);
}
memmove(testprogdir + strlen(pwd) + 1, testprogdir,
- strlen(testprogdir));
+ strlen(testprogdir) + 1);
memcpy(testprogdir, pwd, strlen(pwd));
testprogdir[strlen(pwd)] = '/';
}