From 1f664c140496459f69963da6f8b45755aabca856 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 4 May 2023 10:36:15 +0200 Subject: [PATCH] fix checks --- src/font.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/font.c b/src/font.c index becb885..9bfd191 100644 --- a/src/font.c +++ b/src/font.c @@ -21,14 +21,14 @@ int writeText(GLuint *_textTexId, TTF_Font *font, char *text, SDL_Color color) { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); SDL_Surface *d, *s; - if ((d = TTF_RenderUTF8_Blended_Wrapped(font, text, color, 0)) == NULL) { + if (!(d = TTF_RenderUTF8_Blended_Wrapped(font, text, color, 0))) { freeFont(font); fprintf(stderr, "Erreur TTF : TTF_RenderUTF8_Blended_Wrapped\n"); return 1; } - if ((s = SDL_CreateRGBSurface(0, d->w, d->h, 32, R_MASK, G_MASK, B_MASK, - A_MASK))) { + if (!(s = SDL_CreateRGBSurface(0, d->w, d->h, 32, R_MASK, G_MASK, B_MASK, + A_MASK))) { freeFont(font); fprintf(stderr, "Erreur SDL : %s\n", SDL_GetError()); return 2;