diff options
author | mikhnenko <[email protected]> | 2025-07-15 20:05:43 +0300 |
---|---|---|
committer | mikhnenko <[email protected]> | 2025-07-15 20:52:16 +0300 |
commit | a40bd4f45bbc18fd95b1596e655b8942ceb2cf4b (patch) | |
tree | bce599ca02c778c277198de6d131d37db71997d0 /contrib/libs/cxxsupp/openmp/kmp_str.cpp | |
parent | 728e0eaef4dc1f1152d2c3a4cc1bbdf597f3ef3d (diff) |
Update contrib/libs/cxxsupp/openmp to 20.1.7
commit_hash:722dd5fe79203d22ad4a0be288ac0caeb6b3dd68
Diffstat (limited to 'contrib/libs/cxxsupp/openmp/kmp_str.cpp')
-rw-r--r-- | contrib/libs/cxxsupp/openmp/kmp_str.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/contrib/libs/cxxsupp/openmp/kmp_str.cpp b/contrib/libs/cxxsupp/openmp/kmp_str.cpp index e64f989fbc6..6ee2df72448 100644 --- a/contrib/libs/cxxsupp/openmp/kmp_str.cpp +++ b/contrib/libs/cxxsupp/openmp/kmp_str.cpp @@ -137,8 +137,8 @@ void __kmp_str_buf_cat(kmp_str_buf_t *buffer, char const *str, size_t len) { KMP_DEBUG_ASSERT(len >= 0); __kmp_str_buf_reserve(buffer, buffer->used + len + 1); - KMP_MEMCPY(buffer->str + buffer->used, str, len); - buffer->str[buffer->used + len] = 0; + buffer->str[buffer->used] = '\0'; + KMP_STRNCAT_S(buffer->str + buffer->used, len + 1, str, len); __kmp_type_convert(buffer->used + len, &(buffer->used)); KMP_STR_BUF_INVARIANT(buffer); } // __kmp_str_buf_cat @@ -151,8 +151,8 @@ void __kmp_str_buf_catbuf(kmp_str_buf_t *dest, const kmp_str_buf_t *src) { if (!src->str || !src->used) return; __kmp_str_buf_reserve(dest, dest->used + src->used + 1); - KMP_MEMCPY(dest->str + dest->used, src->str, src->used); - dest->str[dest->used + src->used] = 0; + dest->str[dest->used] = '\0'; + KMP_STRNCAT_S(dest->str + dest->used, src->used + 1, src->str, src->used); dest->used += src->used; KMP_STR_BUF_INVARIANT(dest); } // __kmp_str_buf_catbuf @@ -619,6 +619,21 @@ char *__kmp_str_token( return token; } // __kmp_str_token +int __kmp_basic_str_to_int(char const *str) { + int result; + char const *t; + + result = 0; + + for (t = str; *t != '\0'; ++t) { + if (*t < '0' || *t > '9') + break; + result = (result * 10) + (*t - '0'); + } + + return result; +} + int __kmp_str_to_int(char const *str, char sentinel) { int result, factor; char const *t; |