diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-10-07 21:13:14 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-10-07 21:13:14 -0700 |
commit | a44b587b14843f1efe0da8c65497c5e9f8ea3b14 (patch) | |
tree | add5f4ee43916a99be6bf7e63bb1c16a837b57fd | |
parent | 43f699b9bd9e9a3340fbdd17b869ae3148d9bfe8 (diff) | |
download | nasm-a44b587b14843f1efe0da8c65497c5e9f8ea3b14.tar.gz nasm-a44b587b14843f1efe0da8c65497c5e9f8ea3b14.tar.bz2 nasm-a44b587b14843f1efe0da8c65497c5e9f8ea3b14.zip |
saa_fpwrite: initializing "len" should be part of the loop
"len" should properly be initialized on every turn of the loop. It
can be initialized to any value >= blk_len that fits in a size_t.
(size_t)~0 would work except for any possible noncompliant C compilers
that have a signed size_t (illegal per C99 7.17.2).
-rw-r--r-- | nasmlib.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -727,8 +727,7 @@ void saa_fpwrite(struct SAA *s, FILE * fp) size_t len; saa_rewind(s); - len = s->datalen; - while ((data = saa_rbytes(s, &len)) != NULL) + while (len = s->datalen, (data = saa_rbytes(s, &len)) != NULL) fwrite(data, 1, len, fp); } |