[Python-checkins] CVS: python/dist/src/Modules unicodedata.c,2.13,2.14
Tim Peters
tim_one@users.sourceforge.net
Thu, 29 Nov 2001 23:23:07 -0800
Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv20346/python/Modules
Modified Files:
unicodedata.c
Log Message:
unicodedata_decomposition(): sprintf -> PyOS_snprintf.
Index: unicodedata.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/unicodedata.c,v
retrieving revision 2.13
retrieving revision 2.14
diff -C2 -d -r2.13 -r2.14
*** unicodedata.c 2001/07/19 21:11:13 2.13
--- unicodedata.c 2001/11/30 07:23:05 2.14
***************
*** 228,232 ****
}
! /* high byte is of hex bytes (usually one or two), low byte
is prefix code (from*/
count = decomp_data[index] >> 8;
--- 228,232 ----
}
! /* high byte is number of hex bytes (usually one or two), low byte
is prefix code (from*/
count = decomp_data[index] >> 8;
***************
*** 242,246 ****
if (i)
decomp[i++] = ' ';
! sprintf(decomp + i, "%04X", decomp_data[++index]);
i += strlen(decomp + i);
}
--- 242,248 ----
if (i)
decomp[i++] = ' ';
! assert((size_t)i < sizeof(decomp));
! PyOS_snprintf(decomp + i, sizeof(decomp) - i, "%04X",
! decomp_data[++index]);
i += strlen(decomp + i);
}