lel

farbfeld image viewer
git clone git://git.2f30.org/lel.git
Log | Files | Refs | README | LICENSE

commit 569ab289e66572fcc16959f1f8c55f7d82b17085
parent 049c5f73a2b1174d54d033e10bd5d34373f77884
Author: sin <sin@2f30.org>
Date:   Fri Aug  1 22:22:00 +0100

Fix normalsize()

Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>

Diffstat:
lel.c | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/lel.c b/lel.c @@ -160,12 +160,12 @@ normalsize(char *newbuf) { unsigned int x, y, soff = 0, doff = 0; - for(y = 0; y < imgheight; y++) { - for(x = 0; x < imgwidth; x++, soff += 4, doff += 4) { - newbuf[doff+0] = imgbuf[soff+2]; - newbuf[doff+1] = imgbuf[soff+1]; - newbuf[doff+2] = imgbuf[soff+0]; - newbuf[doff+3] = imgbuf[soff+3]; + for(y = 0; y < cimg->height; y++) { + for(x = 0; x < cimg->width; x++, soff += 4, doff += 4) { + newbuf[doff+0] = cimg->buf[soff+2]; + newbuf[doff+1] = cimg->buf[soff+1]; + newbuf[doff+2] = cimg->buf[soff+0]; + newbuf[doff+3] = cimg->buf[soff+3]; } } }