/****************************************************************************
- * RRDtool 1.2.12 Copyright by Tobi Oetiker, 1997-2005
+ * RRDtool 1.2.13 Copyright by Tobi Oetiker, 1997-2006
****************************************************************************
* rrd_gfx.c graphics wrapper for rrdtool
**************************************************************************/
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