[KoCo-CVS] [Commit] KoreanCodecs/src hangul.c
Brought to you by:
perky
From: Chang <pe...@us...> - 2002-04-26 08:08:03
|
perky 02/04/26 01:03:18 Modified: src hangul.c Log: - Make glibc+gcc happy on linux platform (suppressing warnings ~) - Fix fatal memory deallocation bug on hangul_format Submitted by: Anonymous of www.python.or.kr Revision Changes Path 1.6 +6 -6 KoreanCodecs/src/hangul.c Index: hangul.c =================================================================== RCS file: /cvsroot/koco/KoreanCodecs/src/hangul.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- hangul.c 25 Apr 2002 21:13:45 -0000 1.5 +++ hangul.c 26 Apr 2002 08:03:18 -0000 1.6 @@ -4,14 +4,14 @@ * KoreanCodecs Hangul Module C Implementation * * Author : Hye-Shik Chang <pe...@fa...> - * Date : $Date: 2002/04/25 21:13:45 $ + * Date : $Date: 2002/04/26 08:03:18 $ * Created : 25 April 2002 * - * $Revision: 1.5 $ + * $Revision: 1.6 $ */ static char *version = -"$Id: hangul.c,v 1.5 2002/04/25 21:13:45 perky Exp $"; +"$Id: hangul.c,v 1.6 2002/04/26 08:03:18 perky Exp $"; #include "Python.h" @@ -215,7 +215,7 @@ if (PyUnicode_GET_SIZE(argelems[i])) elems[i] = *uobj; else - elems[i] = NULL; + elems[i] = 0; } if ( (elems[0] && (!isJaeum(elems[0]) || !isChosung(elems[0]))) /* Chosung validity */ @@ -278,7 +278,7 @@ cho = jamo_chosung[hseq / (NJUNGSUNG*NJONGSUNG)]->code; jung = jamo_jungsung[(hseq / NJONGSUNG) % NJUNGSUNG]->code; - if ((t = hseq % NJONGSUNG) != NULL) { + if ((t = hseq % NJONGSUNG)) { jong = jamo_jongsung[t]->code; jongobj = PyUnicode_FromUnicode(&jong, 1); } else { @@ -504,7 +504,6 @@ fmt = PyUnicode_AS_UNICODE(r); fmtsize = PyUnicode_GET_SIZE(r); - Py_DECREF(r); #define HAS_FINAL() ( \ (past = *(fmt-1)), \ @@ -561,6 +560,7 @@ #undef PROCESSSUFFIX, PROCESSSUFFIX_IDA #undef HAS_FINAL, HAS_FINAL_OR_NOTSYL + Py_DECREF(r); r = PyUnicode_FromUnicode(fmtout, fcur-fmtout); out: |