Extend string 1 byte to accommodate terminator

This commit is contained in:
hooper114 2009-08-02 10:18:37 +00:00
parent dc21ca1190
commit 4a31544645

View file

@ -485,9 +485,9 @@ int png_plot(struct zint_symbol *symbol, int rotate_angle)
int scaler = (int)(2 * symbol->scale); int scaler = (int)(2 * symbol->scale);
int default_text_posn; int default_text_posn;
#ifndef _MSC_VER #ifndef _MSC_VER
unsigned char local_text[ustrlen(symbol->text)]; unsigned char local_text[ustrlen(symbol->text) + 1];
#else #else
unsigned char* local_text = (unsigned char*)_alloca(ustrlen(symbol->text)); unsigned char* local_text = (unsigned char*)_alloca(ustrlen(symbol->text) + 1);
#endif #endif
to_latin1(symbol->text, local_text); to_latin1(symbol->text, local_text);