Skip to content

Commit ec7f4af

Browse files
committed
Fix MAX_DATA_SIZE, in case 16 symbols are needed by structured appending
Fix a bug introduced in the commit 3e629c7
1 parent 715e29f commit ec7f4af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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) /* an upper bound (cf. the specification) */
241242
static unsigned char data_buffer[MAX_DATA_SIZE];
242243
static unsigned char *readFile(FILE *fp, int *length)
243244
{

0 commit comments

Comments
 (0)