Skip to content

Commit

Permalink
writeANSI, writeASCII: do not reset size
Browse files Browse the repository at this point in the history
We're reseting size to 1 in writeANSI and writeASCII, this may be
problematic if someone use qrencode as a library.

Let's just ignore it in ASCII/ANSI mode instead.
  • Loading branch information
sgn committed Dec 12, 2019
1 parent f5b0a0e commit aec9bb6
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions qrenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,11 +769,9 @@ static int writeANSI(const QRcode *qrcode, const char *outfile)
}
white_s = strlen(white);

size = 1;

fp = openFile(outfile);

realwidth = (qrcode->width + margin * 2) * size;
realwidth = qrcode->width + margin * 2;
buffer_s = (realwidth * white_s) * 2;
buffer = malloc(buffer_s);
if (buffer == NULL) {
Expand Down Expand Up @@ -958,8 +956,6 @@ static int writeASCII(const QRcode *qrcode, const char *outfile, int invert)
white = '#';
}

size = 1;

fp = openFile(outfile);

realwidth = (qrcode->width + margin * 2) * 2;
Expand Down

0 comments on commit aec9bb6

Please sign in to comment.