From 4a315446450e588bbb23d88746c30b3d2c9b421e Mon Sep 17 00:00:00 2001 From: hooper114 Date: Sun, 2 Aug 2009 10:18:37 +0000 Subject: [PATCH] Extend string 1 byte to accommodate terminator --- backend/png.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/png.c b/backend/png.c index 25ada2ee..fb3e6a52 100644 --- a/backend/png.c +++ b/backend/png.c @@ -485,9 +485,9 @@ int png_plot(struct zint_symbol *symbol, int rotate_angle) int scaler = (int)(2 * symbol->scale); int default_text_posn; #ifndef _MSC_VER - unsigned char local_text[ustrlen(symbol->text)]; + unsigned char local_text[ustrlen(symbol->text) + 1]; #else - unsigned char* local_text = (unsigned char*)_alloca(ustrlen(symbol->text)); + unsigned char* local_text = (unsigned char*)_alloca(ustrlen(symbol->text) + 1); #endif to_latin1(symbol->text, local_text);