On Mon, Sep 20, 2004 at 10:22:14AM +0200, Bastian Blank wrote:
> On Mon, Sep 20, 2004 at 12:49:57AM -0700, Steve Langasek wrote:
> > Please try the attached patch to slang.
> I did some cleanups on the patch.
Some further changes.
Bastian
--=20
One does not thank logic.
-- Sarek, "Journey to Babel", stardate 3842.4
Message-ID: <email address hidden>
Date: Mon, 20 Sep 2004 11:44:37 +0200
From: Bastian Blank <email address hidden>
To: Steve Langasek <email address hidden>, <email address hidden>
Subject: Re: Bug#272136: More progress about the "Arabic crash" in Debian Installer
--zS7rBR6csb6tI2e1 "0vzXIDBeUiKkjN Jl" Disposition: inline
Content-Type: multipart/mixed; boundary=
Content-
--0vzXIDBeUiKkjNJl Disposition: inline Transfer- Encoding: quoted-printable
Content-Type: text/plain; charset=utf-8
Content-
Content-
On Mon, Sep 20, 2004 at 10:22:14AM +0200, Bastian Blank wrote:
> On Mon, Sep 20, 2004 at 12:49:57AM -0700, Steve Langasek wrote:
> > Please try the attached patch to slang.
> I did some cleanups on the patch.
Some further changes.
Bastian
--=20
One does not thank logic.
-- Sarek, "Journey to Babel", stardate 3842.4
--0vzXIDBeUiKkjNJl Disposition: attachment; filename=diff Transfer- Encoding: quoted-printable
Content-Type: text/plain; charset=utf-8
Content-
Content-
diff -ur slang-1. 4.9.orig/ src/slsmg. c slang-1. 4.9-utf8/ src/slsmg. c 4.9.orig/ src/slsmg. c 2004-09-20 09:17:58.000000000 +0200 4.9-utf8/ src/slsmg. c 2004-09-20 10:53:52.000000000 +0200 sizeof( wchar_t) *(n+1)) ; sizeof( wchar_t) * wptr_len); write_nwchars (wptr, i);
--- slang-1.
+++ slang-1.
@@ -309,7 +309,8 @@
if ((int) n < 0)
return;
=20
- wptr =3D (wchar_t *)malloc(
+ size_t wptr_len =3D n + 1;
+ wptr =3D malloc(
=20
if (str !=3D NULL && wptr !=3D NULL)
{
@@ -328,6 +329,14 @@
str +=3D k;
n -=3D w;
i++;
+ /* We have some null-width chars in the string and need more space */
+ if (i >=3D wptr_len) {
+ wchar_t *new_wptr =3D realloc(wptr, sizeof(wchar_t) * wptr_len * 2);
+ if (!new_wptr)
+ break;
+ wptr_len *=3D 2;
+ wptr =3D new_wptr;
+ }
}
SLsmg_
}
--0vzXIDBeUiKkj NJl--
--zS7rBR6csb6tI2e1 pgp-signature; name="signature .asc" Description: Digital signature Disposition: inline
Content-Type: application/
Content-
Content-
-----BEGIN PGP SIGNATURE-----
OpoUACgkQnw66O/ MvCNHWrgCfSLTv0 8f1G01pzaD3Lcjg dSRX qWz5OpXS7/ hLt/xHj
Version: GnuPG v1.2.5 (GNU/Linux)
iEYEARECAAYFAkF
dRAAn0RofHYmsbg
=GtVp
-----END PGP SIGNATURE-----
--zS7rBR6csb6tI 2e1--