12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #include <stddef.h>
- #include <stdlib.h>
- #include <string.h>
- #include "netdissect.h"
- char *
- strdup(str)
- const char *str;
- {
- size_t len;
- char *copy;
- len = strlen(str) + 1;
- if ((copy = malloc(len)) == NULL)
- return (NULL);
- memcpy(copy, str, len);
- return (copy);
- }
|