summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChoe Hwanjin <choe.hwanjin@gmail.com>2008-02-24 10:52:22 +0900
committerChoe Hwanjin <choe.hwanjin@gmail.com>2008-02-24 10:52:22 +0900
commit7624d78733d9f1344a4c3f093d597fed95d2340a (patch)
treecf1c467831bf65ea12b011ae446199ec668bdacd
parent6eaad37ac121619b1a91a6dd5596ce01abe9efe2 (diff)
downloadlibhangul-7624d78733d9f1344a4c3f093d597fed95d2340a.tar.gz
HanjaList, PtrVector는 UINT_MAX를 넘지 않는 범위에서 사용하도록 한다.
git-svn-id: http://kldp.net/svn/hangul/libhangul/trunk@163 8f00fcd2-89fc-0310-932e-b01be5b65e01
-rw-r--r--hangul/hanja.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hangul/hanja.c b/hangul/hanja.c
index ec17c55..2db6c65 100644
--- a/hangul/hanja.c
+++ b/hangul/hanja.c
@@ -333,7 +333,7 @@ ptr_vector_get_length(PtrVector* vector)
static void
ptr_vector_append(PtrVector* vector, void* data)
{
- if (vector->alloc < vector->len + 1) {
+ if (vector->alloc < vector->len + 1 && vector->alloc < UINT_MAX / 2) {
size_t alloc = vector->alloc * 2;
void** ptrs;
@@ -457,7 +457,7 @@ hanja_list_new(const char *key)
static void
hanja_list_reserve(HanjaList* list, size_t n)
{
- if (list->alloc < list->len + n) {
+ if (list->alloc < list->len + n && list->alloc < UINT_MAX / 2) {
const Hanja** data;
size_t size = list->alloc;