diff --git a/client/src/imgutils.c b/client/src/imgutils.c index 09f70faf5..c6c4d0e96 100644 --- a/client/src/imgutils.c +++ b/client/src/imgutils.c @@ -40,13 +40,13 @@ gdImagePtr img_palettize(gdImagePtr rgb, int *palette, int palette_size) { // Create paletized image gdImagePtr res = gdImageCreate(gdImageSX(rgb), gdImageSY(rgb)); - if (!res) { + if (res == NULL) { return NULL; } // Allocate space for palette in YCbCr struct ycbcr_t *pal_ycbcr = calloc(palette_size, sizeof(struct ycbcr_t)); - if (!pal_ycbcr) { + if (pal_ycbcr == NULL) { gdImageDestroy(res); return NULL; } @@ -61,7 +61,7 @@ gdImagePtr img_palettize(gdImagePtr rgb, int *palette, int palette_size) { * and gets divided by that amount when it is read. */ struct ycbcr_t *forward = calloc(gdImageSX(rgb) + 2, sizeof(struct ycbcr_t)); - if (!forward) { + if (forward == NULL) { free(pal_ycbcr); gdImageDestroy(res); return NULL; @@ -162,7 +162,7 @@ gdImagePtr img_crop_to_fit(gdImagePtr orig, int width, int height) { res = gdImageCreate(width, height); } - if (!res) { + if (res == NULL) { return NULL; } diff --git a/client/src/iso4217.c b/client/src/iso4217.c index a385f69ec..df42f9e57 100644 --- a/client/src/iso4217.c +++ b/client/src/iso4217.c @@ -27,8 +27,9 @@ const char *getCurrencyInfo(const char *cn_str) { // skip last element of AtrTable for (int i = 0; i < ARRAYLEN(Iso4217Table) - 1; ++i) { - if (strncmp(cn_str, Iso4217Table[i].code, slen) == 0) + if (strncmp(cn_str, Iso4217Table[i].code, slen) == 0) { return Iso4217Table[i].desc; + } } return Iso4217Table[ARRAYLEN(Iso4217Table) - 1].desc; } diff --git a/client/src/mifare/mad_test.c b/client/src/mifare/mad_test.c index 8fbbbb924..e9ad061ab 100644 --- a/client/src/mifare/mad_test.c +++ b/client/src/mifare/mad_test.c @@ -886,7 +886,7 @@ int exec_mad_test(bool verbose) { ok |= test_write_overflow(verbose); ok |= test_aid_not_found(verbose); ok |= test_write_does_not_touch_trailer(); - ok |= test_mad_sector_untouched_after_write(verbose); + ok |= test_mad_sector_untouched_after_write(); ok |= test_encode_decode_roundtrip(); ok |= test_encode_decode_mad2_roundtrip(); ok |= test_mad2_crc_independent(verbose);