aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/venti
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 /src/cmd/venti
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
Diffstat (limited to 'src/cmd/venti')
-rw-r--r--src/cmd/venti/copy.c2
1 files changed, 1 insertions, 1 deletions
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;