diff options
Diffstat (limited to 'bindings/linux/string.h')
-rw-r--r-- | bindings/linux/string.h | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/bindings/linux/string.h b/bindings/linux/string.h index 69de3fa..30ebf8a 100644 --- a/bindings/linux/string.h +++ b/bindings/linux/string.h @@ -9,18 +9,5 @@ #define UPB_LINUX_STRING_H_ #include <linux/string.h> -#include <stdlib.h> -#include "upb/upb.h" // For INLINE. - -INLINE char *strdup(const char *s) { - size_t len = strlen(s); - char *ret = malloc(len + 1); - if (ret == NULL) return NULL; - // Be particularly defensive and guard against buffer overflow if there - // is a concurrent mutator. - strncpy(ret, s, len); - ret[len] = '\0'; - return ret; -} #endif /* UPB_DEF_H_ */ |