Simplified a bit of C code.

This commit is contained in:
Project Nayuki 2017-08-28 04:03:29 +00:00
parent 4d6185a5d3
commit 8ec5d75766
1 changed files with 2 additions and 2 deletions

View File

@ -31,6 +31,7 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "qrcodegen.h"
#ifndef __cplusplus
@ -90,8 +91,7 @@ int main(void) {
minVersion, maxVersion, (enum qrcodegen_Mask)mask, boostEcl == 1);
free(text);
} else if (length <= bufferLen) {
for (int i = 0; i < length; i++)
tempBuffer[i] = data[i];
memcpy(tempBuffer, data, length * sizeof(data[0]));
ok = qrcodegen_encodeBinary(tempBuffer, (size_t)length, qrcode, (enum qrcodegen_Ecc)errCorLvl,
minVersion, maxVersion, (enum qrcodegen_Mask)mask, boostEcl == 1);
} else