commit a5928d670366448eaed5cda13e7fed50b55ba864
parent 2e29c66e8da6879c8b695ca3dc7beb5c019631a1
Author: Frederic Cambus <fred@statdns.com>
Date: Wed, 21 Oct 2020 19:04:43 +0200
Return error code directly if ctx->length is 0 in the ANSI and PCBoard loaders.
Diffstat:
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/loaders/ansi.c b/src/loaders/ansi.c
@@ -97,7 +97,7 @@ ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options)
if (!ctx->length) {
ctx->error = ANSILOVE_FORMAT_ERROR;
- goto error;
+ return -1;
}
/* Default to 80 columns if columns option wasn't set */
diff --git a/src/loaders/pcboard.c b/src/loaders/pcboard.c
@@ -63,7 +63,7 @@ ansilove_pcboard(struct ansilove_ctx *ctx, struct ansilove_options *options)
if (!ctx->length) {
ctx->error = ANSILOVE_FORMAT_ERROR;
- goto error;
+ return -1;
}
options->columns = options->columns ? options->columns : 80;