/****************************************************************************
- * RRDtool 1.2.9 Copyright by Tobi Oetiker, 1997-2005
+ * RRDtool 1.2.11 Copyright by Tobi Oetiker, 1997-2005
****************************************************************************
* rrd_gfx.c graphics wrapper for rrdtool
**************************************************************************/
cstr = malloc(sizeof(wchar_t) * clen); /* yes we are allocating probably too much here, I know */
string->count=mbstowcs(cstr,text,clen);
if ( string->count == -1){
- string->count=mbstowcs(cstr,"Enc-Err",6);
+ /* conversion did not work, so lets fall back to just use what we got */
+ string->count=clen-1;
+ for(n=0;text[n] != '\0';n++){
+ cstr[n]=(unsigned char)text[n];
+ }
}
#else
char *cstr = strdup(text);