diff options
author | Darin Adler <darin@src.gnome.org> | 2001-03-09 22:38:49 +0000 |
---|---|---|
committer | Darin Adler <darin@src.gnome.org> | 2001-03-09 22:38:49 +0000 |
commit | 18f2e524fcdd05f37176f335735150da6d332125 (patch) | |
tree | 919d96a468998d0cbf694ba24f3603926026acb4 | |
parent | e177bd94e75e190a39adc5f6f19de4a954205c54 (diff) | |
download | nautilus-18f2e524fcdd05f37176f335735150da6d332125.tar.gz |
roll out accidentally-checked-in change
-rw-r--r-- | librsvg/rsvg-ft.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/librsvg/rsvg-ft.c b/librsvg/rsvg-ft.c index b3d2d6347..edcf4c795 100644 --- a/librsvg/rsvg-ft.c +++ b/librsvg/rsvg-ft.c @@ -867,17 +867,18 @@ rsvg_ft_measure_or_render_string (RsvgFTCtx *ctx, init_y = affine[5]; n_glyphs = 0; + /* Alloc max length of wide char */ + wcstr = g_new0 (wchar_t, length); + wclength = mbstowcs (wcstr, str, length); + /* mbstowcs fallback. 0 means not found any wide chars. * -1 means an invalid sequence was found. In either of * these two cases we fill in the wide char array with * the single byte chars. */ - wclength = mbstowcs (NULL, str, 0); if (wclength > 0) { - wcstr = g_new0 (wchar_t, wclength + 1); - length = mbstowcs (wcstr, str, wclength + 1); + length = wclength; } else { - wcstr = g_new0 (wchar_t, length); for (i = 0; i < length; i++) { wcstr[i] = (unsigned char) str[i]; } |