venti/copy: fix bug writing directories that zero truncate

Found by nwf.

TBR=rsc
https://codereview.appspot.com/162860045
This commit is contained in:
Russ Cox 2014-10-21 07:25:13 -04:00
parent 72197f89d4
commit 2763a6d832
2 changed files with 2 additions and 1 deletions

View file

@ -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;