From e1596c3b076bdcbb4bfe5bbc3134ee46975c6f0e Mon Sep 17 00:00:00 2001 From: Project Nayuki Date: Thu, 20 Apr 2017 18:11:22 +0000 Subject: [PATCH] Fixed bug in C code due to implicit non-Boolean conditions and incorrect refactoring (related to commit af67fe1c0b2a). --- c/qrcodegen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c/qrcodegen.c b/c/qrcodegen.c index fbc72c6..4a8831a 100644 --- a/c/qrcodegen.c +++ b/c/qrcodegen.c @@ -216,9 +216,9 @@ static int getTextProperties(const char *text, bool *isNumeric, bool *isAlphanum } long tempBits; - if (isNumeric) + if (*isNumeric) tempBits = textLen * 3L + (textLen + 2L) / 3; - else if (isAlphanumeric) + else if (*isAlphanumeric) tempBits = textLen * 5L + (textLen + 1L) / 2; else // Binary mode tempBits = textLen * 8L;