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 afbb3d4 commit 8239441
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 @@ -772,11 +772,9 @@ static int writeANSI(const QRcode *qrcode, const char *outfile)
white_s = strlen(white);
black_s = strlen(black);

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 @@ -961,8 +959,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 8239441

Please sign in to comment.