From 0ea4c21e45788e8f7682e5b45cb1600b6d8a6b61 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 27 Jan 2018 17:31:24 -0500 Subject: [PATCH] xcf: fix code formatting. --- IMG_xcf.c | 49 ++++++++++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/IMG_xcf.c b/IMG_xcf.c index 079e5442..f197a89e 100755 --- a/IMG_xcf.c +++ b/IMG_xcf.c @@ -497,11 +497,11 @@ static unsigned char * load_xcf_tile_rle (SDL_RWops * src, Uint32 len, int bpp, length = val; if (length >= 128) { - length = 255 - (length - 1); - if (length == 128) { - length = (*t << 8) + t[1]; - t += 2; - } + length = 255 - (length - 1); + if (length == 128) { + length = (*t << 8) + t[1]; + t += 2; + } if (((size_t) (t - load) + length) >= len) { break; /* bogus data */ @@ -509,20 +509,19 @@ static unsigned char * load_xcf_tile_rle (SDL_RWops * src, Uint32 len, int bpp, break; /* bogus data */ } - count += length; - size -= length; + count += length; + size -= length; - while (length-- > 0) { - *d = *t++; - d += bpp; - } - } - else { - length += 1; - if (length == 128) { - length = (*t << 8) + t[1]; - t += 2; - } + while (length-- > 0) { + *d = *t++; + d += bpp; + } + } else { + length += 1; + if (length == 128) { + length = (*t << 8) + t[1]; + t += 2; + } if (((size_t) (t - load)) >= len) { break; /* bogus data */ @@ -530,15 +529,15 @@ static unsigned char * load_xcf_tile_rle (SDL_RWops * src, Uint32 len, int bpp, break; /* bogus data */ } - count += length; - size -= length; + count += length; + size -= length; - val = *t++; + val = *t++; - for (j = 0; j < length; j++) { - *d = val; - d += bpp; - } + for (j = 0; j < length; j++) { + *d = val; + d += bpp; + } } }