diff options
author | simokawa <simokawa@FreeBSD.org> | 2003-01-04 10:32:31 +0000 |
---|---|---|
committer | simokawa <simokawa@FreeBSD.org> | 2003-01-04 10:32:31 +0000 |
commit | f588520584c4c7e47c45be721a5670ee6691f9f6 (patch) | |
tree | 324f01bfea04475b4c32853de390bd22f30a5d30 /usr.sbin/fwcontrol/fwcrom.c | |
parent | add68c49b8bbbd4fbacfa1989dbaa46bccfe6b67 (diff) | |
download | FreeBSD-src-f588520584c4c7e47c45be721a5670ee6691f9f6.zip FreeBSD-src-f588520584c4c7e47c45be721a5670ee6691f9f6.tar.gz |
- Handle zero sized directory right way.
- Staticize.
Diffstat (limited to 'usr.sbin/fwcontrol/fwcrom.c')
-rw-r--r-- | usr.sbin/fwcontrol/fwcrom.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/fwcontrol/fwcrom.c b/usr.sbin/fwcontrol/fwcrom.c index 34e1674..d58be50 100644 --- a/usr.sbin/fwcontrol/fwcrom.c +++ b/usr.sbin/fwcontrol/fwcrom.c @@ -90,14 +90,15 @@ crom_next(struct crom_context *cc) cc->depth --; goto again; } - cc->stack[cc->depth].dir = (struct csrdirectory *) - (reg + reg->val); - cc->stack[cc->depth].index = 0; - return; + ptr = &cc->stack[cc->depth]; + ptr->dir = (struct csrdirectory *) (reg + reg->val); + ptr->index = 0; + goto check; } again: ptr = &cc->stack[cc->depth]; ptr->index ++; +check: if (ptr->index < ptr->dir->crc_len) return; if (cc->depth > 0) { |