From a6acd72b192b09f290a295073fbbad8ca8798ee2 Mon Sep 17 00:00:00 2001 From: Pierre Colombier Date: Tue, 15 Feb 2022 12:33:06 +0100 Subject: [PATCH] add realmargin rows just like for top margin + always terminate the block even if realmargin==0 --- qrenc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qrenc.c b/qrenc.c index c09c4ab6..d26b0d2f 100644 --- a/qrenc.c +++ b/qrenc.c @@ -724,9 +724,11 @@ static int writeXPM(const QRcode *qrcode, const char *outfile) } for (y = 0; y < realmargin; y++) { - fprintf(fp, "\"%s\"%s\n", row, y < (size - 1) ? "," : "};"); + fprintf(fp, "\"%s\",\n", row); } + fputs("};\n", fp); + free(row); fclose(fp);