summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2001-03-09 22:38:49 +0000
committerDarin Adler <darin@src.gnome.org>2001-03-09 22:38:49 +0000
commit18f2e524fcdd05f37176f335735150da6d332125 (patch)
tree919d96a468998d0cbf694ba24f3603926026acb4
parente177bd94e75e190a39adc5f6f19de4a954205c54 (diff)
downloadnautilus-18f2e524fcdd05f37176f335735150da6d332125.tar.gz
roll out accidentally-checked-in change
-rw-r--r--librsvg/rsvg-ft.c9
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];
}