| 983 | } |
| 984 | |
| 985 | static inline char *pkg_strdup(const char *str) |
| 986 | { |
| 987 | char *rval; |
| 988 | int len; |
| 989 | |
| 990 | if (!str) |
| 991 | return NULL; |
| 992 | |
| 993 | len = strlen(str) + 1; |
| 994 | rval = pkg_malloc(len); |
| 995 | if (!rval) |
| 996 | return NULL; |
| 997 | memcpy(rval, str, len); |
| 998 | return rval; |
| 999 | } |
| 1000 | |
| 1001 | /* Extend the given buffer only if needed */ |
| 1002 | static inline int pkg_str_extend(str *in, int size) |
no outgoing calls