aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2014-10-21 07:25:13 -0400
committerRuss Cox <rsc@swtch.com>2014-10-21 07:25:13 -0400
commit2763a6d8324fc5e1296e9a50a067ec04d52c581f (patch)
tree4adedda2661c1955c4b9547e527a5c5adad2cf90
parent72197f89d47444e3c62e1aa0df8bd7059c29104d (diff)
downloadplan9port-2763a6d8324fc5e1296e9a50a067ec04d52c581f.tar.gz
plan9port-2763a6d8324fc5e1296e9a50a067ec04d52c581f.tar.bz2
plan9port-2763a6d8324fc5e1296e9a50a067ec04d52c581f.zip
venti/copy: fix bug writing directories that zero truncate
Found by nwf. TBR=rsc https://codereview.appspot.com/162860045
-rw-r--r--CONTRIBUTORS1
-rw-r--r--src/cmd/venti/copy.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 36522a1d..0b9a5415 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -37,6 +37,7 @@ Mathieu Lonjaret <lejatorn@gmail.com>
Mathieu Lonjaret <mathieu.lonjaret@gmail.com>
Michael Teichgräber <mt4swm@googlemail.com>
Michael Teichgräber <mt@ib.wmipf.de>
+Nathaniel W Filardo <nwf@cs.jhu.edu> <nwfilardo@gmail.com>
Nikolai Saoukh <nikolai.saoukh@gmail.com>
Yuval Pavel Zholkover <paulzhol@gmail.com>
Peter Saveliev <svinota.saveliev@gmail.com>
diff --git a/src/cmd/venti/copy.c b/src/cmd/venti/copy.c
index 8c791f2a..d6d770bc 100644
--- a/src/cmd/venti/copy.c
+++ b/src/cmd/venti/copy.c
@@ -136,7 +136,7 @@ walk(uchar score[VtScoreSize], uint type, int base, int depth)
break;
case VtDirType:
- for(i=0; i<n/VtEntrySize; i++){
+ for(i=0; i*VtEntrySize < n; i++){
if(vtentryunpack(&e, buf, i) < 0){
fprint(2, "warning: could not unpack entry #%d in %V %d\n", i, score, type);
continue;