diff --git a/program/src/rrd_gfx.c b/program/src/rrd_gfx.c
index 5841d50867883e5c9d27581261ba31b649ab82bd..a71d43a01de5bfe95212b4c435a1383f8ca5f631 100644 (file)
--- a/program/src/rrd_gfx.c
+++ b/program/src/rrd_gfx.c
text_count = mbstowcs(cstr, "Enc-Err", 6);
p = cstr;
#else
- const unsigned char *p = text, ch;
+ unsigned char *p = text;
+ unsigned char *cstr;
+ char ch;
if (!p)
return;
#endif
ch = afm_fix_osx_charset(ch); /* unsafe macro */
switch (ch) {
case 0:
-#ifdef HAVE_MBSTOWCS
+#ifdef HAVE_MBSTOWCS
free(cstr);
#endif
return;
case '"': fputs(""", fp); break;
default:
if (ch == 32) {
-#ifdef HAVE_MBSTOWCS
+#ifdef HAVE_MBSTOWCS
if (p <= cstr + 1 || !*p || *p == 32)
fputs(" ", fp); /* non-breaking space in unicode */
else
text_count = mbstowcs(cstr, "Enc-Err", 6);
p = cstr;
#else
- const unsigned char *p = node->text, ch;
+ const unsigned char *p = node->text;
+ unsigned char ch;
if (!p)
return;
#endif