diff options
Diffstat (limited to 'Src/utils.c')
-rw-r--r-- | Src/utils.c | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/Src/utils.c b/Src/utils.c index 3ffb4388a..4ec73d7be 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -3438,86 +3438,6 @@ strsfx(char *s, char *t) } /**/ -mod_export char * -dupstrpfx(const char *s, int len) -{ - char *r = zhalloc(len + 1); - - memcpy(r, s, len); - r[len] = '\0'; - return r; -} - -/**/ -mod_export char * -ztrduppfx(const char *s, int len) -{ - char *r = zalloc(len + 1); - - memcpy(r, s, len); - r[len] = '\0'; - return r; -} - -/* Append a string to an allocated string, reallocating to make room. */ - -/**/ -mod_export char * -appstr(char *base, char const *append) -{ - return strcat(realloc(base, strlen(base) + strlen(append) + 1), append); -} - -/* concatenate s1, s2, and s3 in dynamically allocated buffer */ - -/**/ -mod_export char * -tricat(char const *s1, char const *s2, char const *s3) -{ - /* This version always uses permanently-allocated space. */ - char *ptr; - size_t l1 = strlen(s1); - size_t l2 = strlen(s2); - - ptr = (char *)zalloc(l1 + l2 + strlen(s3) + 1); - strcpy(ptr, s1); - strcpy(ptr + l1, s2); - strcpy(ptr + l1 + l2, s3); - return ptr; -} - -/**/ -mod_export char * -zhtricat(char const *s1, char const *s2, char const *s3) -{ - char *ptr; - size_t l1 = strlen(s1); - size_t l2 = strlen(s2); - - ptr = (char *)zhalloc(l1 + l2 + strlen(s3) + 1); - strcpy(ptr, s1); - strcpy(ptr + l1, s2); - strcpy(ptr + l1 + l2, s3); - return ptr; -} - -/* concatenate s1 and s2 in dynamically allocated buffer */ - -/**/ -mod_export char * -dyncat(char *s1, char *s2) -{ - /* This version always uses space from the current heap. */ - char *ptr; - size_t l1 = strlen(s1); - - ptr = (char *)zhalloc(l1 + strlen(s2) + 1); - strcpy(ptr, s1); - strcpy(ptr + l1, s2); - return ptr; -} - -/**/ static int upchdir(int n) { |