venti/copy: fix bug writing directories that zero truncate
Found by nwf. TBR=rsc https://codereview.appspot.com/162860045
This commit is contained in:
parent
72197f89d4
commit
2763a6d832
2 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue