From 01c10843099873d23077a62afa9f322d40a11a15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?= <grubba@grubba.org> Date: Sat, 10 Oct 1998 00:44:25 +0200 Subject: [PATCH] Fixed bug in string_to_unicode(). Rev: src/builtin_functions.c:1.125 --- src/builtin_functions.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/builtin_functions.c b/src/builtin_functions.c index 99d73835b6..94dc271940 100644 --- a/src/builtin_functions.c +++ b/src/builtin_functions.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: builtin_functions.c,v 1.124 1998/10/09 22:28:35 grubba Exp $"); +RCSID("$Id: builtin_functions.c,v 1.125 1998/10/09 22:44:25 grubba Exp $"); #include "interpret.h" #include "svalue.h" #include "pike_macros.h" @@ -650,7 +650,8 @@ void f_string_to_unicode(INT32 args) /* 32 bit characters -- Is someone writing in Klingon? */ { p_wchar2 *str2 = STR2(in); - int j = (len = in->len * 2); + int j; + len = in->len * 2; /* Check how many extra wide characters there are. */ for(i = in->len; i--;) { if (str2[i] > 0xfffd) { @@ -672,7 +673,7 @@ void f_string_to_unicode(INT32 args) } } out = begin_shared_string(len); - /* j is initialized above. */ + j = len; for(i = in->len; i--;) { unsigned INT32 c = str2[i]; -- GitLab