diff options
author | mischief <mischief@offblast.org> | 2018-08-06 09:41:28 -0700 |
---|---|---|
committer | mischief <mischief@offblast.org> | 2018-08-06 09:41:28 -0700 |
commit | eb1be5b4df533c4e5100296fb042e274da435b5b (patch) | |
tree | 596dd5ac12a7a3184f1bd230aa7c55d2cc13ced7 | |
parent | 796c41092aeb76bbbb151b56865b0355080d97c1 (diff) | |
download | plan9front-eb1be5b4df533c4e5100296fb042e274da435b5b.tar.xz |
devaoe: really fix unit numbering, to be 0-based
-rw-r--r-- | sys/src/9/port/devaoe.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/src/9/port/devaoe.c b/sys/src/9/port/devaoe.c index ce8f51ec7..ed091df0a 100644 --- a/sys/src/9/port/devaoe.c +++ b/sys/src/9/port/devaoe.c @@ -949,7 +949,7 @@ aoegen(Chan *c, char *, Dirtab *, int, int s, Dir *dp) return unitgen(c, TYPE(c->qid), dp); case Qdevlinkdir: i = UNIT(c->qid); - if(i > Maxunits || i > units.ref) + if(i >= Maxunits || i >= units.ref) return -1; d = unit2dev(i); if(s == DEVDOTDOT){ @@ -1728,7 +1728,7 @@ newunit(void) { int x; - x = incref(&units); + x = incref(&units)-1; if(x >= Maxunits){ decref(&units); x = -1; |