mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-06 05:55:35 +00:00
parent
3d62b74392
commit
17f725fe0d
2 changed files with 17 additions and 3 deletions
|
@ -31,14 +31,25 @@
|
|||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include "unicode/localpointer.h"
|
||||
#include "uassert.h"
|
||||
|
||||
#if U_DEBUG && defined(UPRV_MALLOC_COUNT)
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
|
||||
#define uprv_memcpy(dst, src, size) U_STANDARD_CPP_NAMESPACE memcpy(dst, src, size)
|
||||
#define uprv_memmove(dst, src, size) U_STANDARD_CPP_NAMESPACE memmove(dst, src, size)
|
||||
#define uprv_memcpy(dst, src, size) UPRV_BLOCK_MACRO_BEGIN { \
|
||||
U_ASSERT(dst != NULL); \
|
||||
U_ASSERT(src != NULL); \
|
||||
U_STANDARD_CPP_NAMESPACE memcpy(dst, src, size); \
|
||||
} UPRV_BLOCK_MACRO_END
|
||||
|
||||
#define uprv_memmove(dst, src, size) UPRV_BLOCK_MACRO_BEGIN { \
|
||||
U_ASSERT(dst != NULL); \
|
||||
U_ASSERT(src != NULL); \
|
||||
U_STANDARD_CPP_NAMESPACE memmove(dst, src, size); \
|
||||
} UPRV_BLOCK_MACRO_END
|
||||
|
||||
|
||||
/**
|
||||
* \def UPRV_LENGTHOF
|
||||
|
|
|
@ -2047,7 +2047,10 @@ ultag_parse(const char* tag, int32_t tagLen, int32_t* parsedLen, UErrorCode* sta
|
|||
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
uprv_memcpy(tagBuf, tag, tagLen);
|
||||
|
||||
if (tagLen > 0) {
|
||||
uprv_memcpy(tagBuf, tag, tagLen);
|
||||
}
|
||||
*(tagBuf + tagLen) = 0;
|
||||
|
||||
/* create a ULanguageTag */
|
||||
|
|
Loading…
Add table
Reference in a new issue