X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Frrd_gfx.c;h=7084720bc259b7bd1884a0e127aeaa651e5cc033;hb=afdb6e580328bfea9570035f4d30e1c80ba6034a;hp=44f668b8b70184de4248a0e600ebeefaa5dac94a;hpb=002267b3ae6b25f7965dea8b8d25203f79dafa7b;p=rrdtool.git diff --git a/src/rrd_gfx.c b/src/rrd_gfx.c index 44f668b..7084720 100644 --- a/src/rrd_gfx.c +++ b/src/rrd_gfx.c @@ -1,5 +1,5 @@ /**************************************************************************** - * 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 **************************************************************************/ @@ -386,7 +386,11 @@ gfx_string gfx_string_create(gfx_canvas_t *canvas, FT_Face face,const char *text 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);