Skip to content

Commit a9c21d6

Browse files
committed
Fix MAX_DATA_SIZE, in case 16 symbols are needed by structured appending
1 parent 715e29f commit a9c21d6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

qrenc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#endif
3333

3434
#include "qrencode.h"
35+
#include "qrinput.h"
3536

3637
#define INCHES_PER_METER (100.0/2.54)
3738

@@ -237,7 +238,7 @@ static int color_set(unsigned char color[4], const char *value)
237238
return 0;
238239
}
239240

240-
#define MAX_DATA_SIZE (7090 * 2) /* timed by the safty factor 2 */
241+
#define MAX_DATA_SIZE ( (7089 * MAX_STRUCTURED_SYMBOLS + 1) * 2) /* timed by the safty factor 2 */
241242
static unsigned char data_buffer[MAX_DATA_SIZE];
242243
static unsigned char *readFile(FILE *fp, int *length)
243244
{

0 commit comments

Comments
 (0)