Ignore:
Timestamp:
May 19, 2013, 9:20:51 AM (6 years ago)
Author:
cameron
Message:

Fixes for icXML 0.9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icXML/icXML-devel/src/icxmlc/XMLSymbolTable.hpp

    r3151 r3157  
    77/*
    88 * @author Nigel Medforth, nigelm -at- interational-characters.com
    9  * @version $Id: XMLSymbolTable.hpp 312 2013-05-10 20:53:22Z nigelm $
     9 * @version $Id: XMLSymbolTable.hpp 318 2013-05-16 02:45:25Z nigelm $
    1010 *
    1111 */
     
    364364)
    365365{
    366     XMLByte * unencodedKey = (XMLByte *)fMemoryManager->allocate((length * 3) + 1);
    367     XMLSize_t unencodedLength;
    368     unencodedLength = fTranscoder->transcodeTo(key, length, unencodedKey, length * 3, unencodedLength, XMLTranscoder::UnRep_Throw);
    369     unencodedKey[unencodedLength] = 0;
    370 
    371     gid_t gid = fSymbolTable.find(unencodedKey, unencodedLength);
     366    Janitor<XMLByte> janSourceKey((XMLByte *)fMemoryManager->allocate((length * 3) + 1));
     367    XMLByte * sourceKey = janSourceKey.get();
     368    XMLSize_t sourceLength = fTranscoder->transcodeTo(key, length, sourceKey, length * 3, sourceLength, XMLTranscoder::UnRep_Throw);
     369    sourceKey[sourceLength] = 0;
     370
     371    gid_t gid = fSymbolTable.find(sourceKey, sourceLength);
    372372
    373373    if (unlikely(gid == -1))
    374374    {
    375         gid = addInternal(key, length, unencodedKey, unencodedLength);
    376     }
    377     fMemoryManager->deallocate(unencodedKey);
     375        gid = addInternal(key, length, sourceKey, sourceLength);
     376    }
    378377    return gid;
    379378}
Note: See TracChangeset for help on using the changeset viewer.