X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=pdf2swf%2Fxpdf%2FDict.cc;h=627459078a0a7c8fcb5d315f0cfae38d75471e70;hb=419089c30d9ee015ee1a7949dbc87c1380cdb240;hp=5eb077e0937cab2186de3417d37230bd5c010d12;hpb=50dd339d3d6262763616efe8d7ee415ab19befb9;p=swftools.git diff --git a/pdf2swf/xpdf/Dict.cc b/pdf2swf/xpdf/Dict.cc index 5eb077e..6274590 100644 --- a/pdf2swf/xpdf/Dict.cc +++ b/pdf2swf/xpdf/Dict.cc @@ -2,15 +2,16 @@ // // Dict.cc // -// Copyright 1996-2002 Glyph & Cog, LLC +// Copyright 1996-2003 Glyph & Cog, LLC // //======================================================================== -#ifdef __GNUC__ +#include + +#ifdef USE_GCC_PRAGMAS #pragma implementation #endif -#include #include #include #include "gmem.h" @@ -40,8 +41,12 @@ Dict::~Dict() { } void Dict::add(char *key, Object *val) { - if (length + 1 > size) { - size += 8; + if (length == size) { + if (length == 0) { + size = 8; + } else { + size *= 2; + } entries = (DictEntry *)grealloc(entries, size * sizeof(DictEntry)); } entries[length].key = key;