--- parser3/src/main/pa_pool.C 2002/08/15 10:13:19 1.56 +++ parser3/src/main/pa_pool.C 2002/12/24 09:55:34 1.58 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_POOL_C="$Date: 2002/08/15 10:13:19 $"; +static const char* IDENT_POOL_C="$Date: 2002/12/24 09:55:34 $"; #include "pa_pool.h" #include "pa_exception.h" @@ -21,6 +21,9 @@ Pool::Pool(void *astorage) : } void *Pool::copy(const void *buf, const size_t size) { + if(!buf || !size) + return 0; + void *result=malloc(size); memcpy(result, buf, size); return result; @@ -74,16 +77,24 @@ const char *Pool::transcode_cstr(xmlChar return get_source_charset().transcode_cstr(s); } -String& Pool::transcode(xmlChar *s) { - return get_source_charset().transcode(s); +String& Pool::transcode(xmlChar *s +#ifndef NO_STRING_ORIGIN + , const String *origin +#endif + ) { + return get_source_charset().transcode(s, origin); } const char *Pool::transcode_cstr(GdomeDOMString *s) { return get_source_charset().transcode_cstr(s); } -String& Pool::transcode(GdomeDOMString *s) { - return get_source_charset().transcode(s); +String& Pool::transcode(GdomeDOMString *s +#ifndef NO_STRING_ORIGIN + , const String *origin +#endif + ) { + return get_source_charset().transcode(s, origin); } xmlChar *Pool::transcode_buf2xchar(const char *buf, size_t buf_size) {