diff options
author | snermolaev <snermolaev@yandex-team.ru> | 2022-02-10 16:45:53 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:53 +0300 |
commit | 2015790ac9fcc04caab83fccc23ab2460310a797 (patch) | |
tree | e644e9bc3f6f688561a871793b59bf8a637e0f72 /contrib/libs/c-ares/ares_strdup.c | |
parent | c768a99151e47c3a4bb7b92c514d256abd301c4d (diff) | |
download | ydb-2015790ac9fcc04caab83fccc23ab2460310a797.tar.gz |
Restoring authorship annotation for <snermolaev@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/c-ares/ares_strdup.c')
-rw-r--r-- | contrib/libs/c-ares/ares_strdup.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/contrib/libs/c-ares/ares_strdup.c b/contrib/libs/c-ares/ares_strdup.c index 0c3dcffc30..73e12e3479 100644 --- a/contrib/libs/c-ares/ares_strdup.c +++ b/contrib/libs/c-ares/ares_strdup.c @@ -17,33 +17,33 @@ #include "ares_setup.h" #include "ares_strdup.h" -#include "ares.h" -#include "ares_private.h" +#include "ares.h" +#include "ares_private.h" char *ares_strdup(const char *s1) { -#ifdef HAVE_STRDUP - if (ares_malloc == malloc) - return strdup(s1); - else -#endif - { - size_t sz; - char * s2; +#ifdef HAVE_STRDUP + if (ares_malloc == malloc) + return strdup(s1); + else +#endif + { + size_t sz; + char * s2; - if(s1) { - sz = strlen(s1); - if(sz < (size_t)-1) { - sz++; - if(sz < ((size_t)-1) / sizeof(char)) { - s2 = ares_malloc(sz * sizeof(char)); - if(s2) { - memcpy(s2, s1, sz * sizeof(char)); - return s2; - } + if(s1) { + sz = strlen(s1); + if(sz < (size_t)-1) { + sz++; + if(sz < ((size_t)-1) / sizeof(char)) { + s2 = ares_malloc(sz * sizeof(char)); + if(s2) { + memcpy(s2, s1, sz * sizeof(char)); + return s2; + } } } } - return (char *)NULL; + return (char *)NULL; } } |