libansilove

Library for converting ANSI, ASCII, and other formats to PNG
Log | Files | Refs | README | LICENSE

commit 24b376aba85932e4abc038a42df9b884ab7263da
parent 59678ee9b3585e427fdeb6171dbec2eab2c81b99
Author: Frederic Cambus <fred@statdns.com>
Date:   Mon, 28 Sep 2020 18:00:06 +0200

We don't need to use else clauses here.

Diffstat:
Msrc/loaders/ansi.c | 4++--
Msrc/loaders/icedraw.c | 8++++----
Msrc/loaders/pcboard.c | 4++--
3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/loaders/ansi.c b/src/loaders/ansi.c @@ -170,9 +170,9 @@ ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options) ctx->error = ANSILOVE_MEMORY_ERROR; free(ansi_buffer); return -1; - } else { - ansi_buffer = ptr; } + + ansi_buffer = ptr; } if (invert) { diff --git a/src/loaders/icedraw.c b/src/loaders/icedraw.c @@ -65,10 +65,10 @@ ansilove_icedraw(struct ansilove_ctx *ctx, struct ansilove_options *options) ctx->error = ANSILOVE_MEMORY_ERROR; free(idf_buffer); return -1; - } else { - idf_buffer = ptr; } + idf_buffer = ptr; + idf_buffer[i] = ctx->buffer[loop + 4]; idf_buffer[i+1] = ctx->buffer[loop + 5]; i += 2; @@ -81,10 +81,10 @@ ansilove_icedraw(struct ansilove_ctx *ctx, struct ansilove_options *options) ctx->error = ANSILOVE_MEMORY_ERROR; free(idf_buffer); return -1; - } else { - idf_buffer = ptr; } + idf_buffer = ptr; + /* normal character */ idf_buffer[i] = ctx->buffer[loop]; idf_buffer[i+1] = ctx->buffer[loop + 1]; diff --git a/src/loaders/pcboard.c b/src/loaders/pcboard.c @@ -107,10 +107,10 @@ ansilove_pcboard(struct ansilove_ctx *ctx, struct ansilove_options *options) if (ptr == NULL) { ctx->error = ANSILOVE_MEMORY_ERROR; goto error; - } else { - pcboard_buffer = ptr; } + pcboard_buffer = ptr; + /* write current character in pcbChar struct */ pcboard_buffer[structIndex] = (struct pcbChar) { .column = column,