From a44b587b14843f1efe0da8c65497c5e9f8ea3b14 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sun, 7 Oct 2007 21:13:14 -0700 Subject: [PATCH] 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). --- nasmlib.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nasmlib.c b/nasmlib.c index 9c24db76..c98834c0 100644 --- a/nasmlib.c +++ b/nasmlib.c @@ -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); } -- 2.11.4.GIT