[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PATCH: remove one hardcoded assumption of sizeof(wchar_t) == 4 in gsm-en

From: Alex Villací­s Lasso
Subject: PATCH: remove one hardcoded assumption of sizeof(wchar_t) == 4 in gsm-encoding.c
Date: Tue, 24 Oct 2006 13:10:44 -0500
User-agent: Thunderbird (X11/20060913)

One line fix:

At line 161 of common/gsm-encoding.c in char_mbtowc(), reserved space for exactly one wchar_t is hardcoded as 4 bytes. This fails to work in cygwin/WinXP where wchar_t is 2 bytes. Replacing 4 with sizeof(wchar_t) fixes it for me.

* Use sizeof(wchar_t) instead of hardcoded 4 for the size of exactly one output wchar_t

Alex Villacís Lasso

The following cryptic message was allegedly found in the inner edge of a Windows
XP installation CD:


It is rumored that only a true Unix Wizard can decypher this mysterious message,
which supposedly encodes the true nature and purpose of the software.

diff -ur gnokii-0.6.14/common/gsm-encoding.c 
--- gnokii-0.6.14/common/gsm-encoding.c 2006-08-27 17:36:54.000000000 -0500
+++ gnokii-0.6.14-patch/common/gsm-encoding.c   2006-10-24 09:27:32.000000000 
@@ -158,7 +158,7 @@
        pin = (char *)src;
        pout = (char *)dst;
        inlen = 4;
-       outlen = 4;
+       outlen = sizeof(wchar_t);
        cd = iconv_open("WCHAR_T", gn_char_get_encoding());
        nconv = iconv(cd, &pin, &inlen, &pout, &outlen);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]