Add braces to avoid dangling-else problem.

When compiling under clang, it detects that this clause might
suffer from the dangling else problem and issues a diagnostic.
This commit is contained in:
Luke Granger-Brown 2019-07-03 11:17:17 +01:00
parent 292b4d038c
commit 634feae2c3

View File

@ -66,13 +66,14 @@ typedef void (*hline_handler)(Imaging, int, int, int, int);
static inline void static inline void
point8(Imaging im, int x, int y, int ink) point8(Imaging im, int x, int y, int ink)
{ {
if (x >= 0 && x < im->xsize && y >= 0 && y < im->ysize) if (x >= 0 && x < im->xsize && y >= 0 && y < im->ysize) {
if (strncmp(im->mode, "I;16", 4) == 0) { if (strncmp(im->mode, "I;16", 4) == 0) {
im->image8[y][x*2] = (UINT8) ink; im->image8[y][x*2] = (UINT8) ink;
im->image8[y][x*2+1] = (UINT8) ink; im->image8[y][x*2+1] = (UINT8) ink;
} else { } else {
im->image8[y][x] = (UINT8) ink; im->image8[y][x] = (UINT8) ink;
} }
}
} }
static inline void static inline void