diff --git a/spooldir.c b/spooldir.c index 6c7306d..8d5fead 100644 --- a/spooldir.c +++ b/spooldir.c @@ -141,7 +141,7 @@ spooldir_next(struct spooldir *s) { struct stat sb; struct dirent *de; - char *ret = NULL; + uint8_t *ubuf_str = NULL; size_t retsz; char *fname = NULL; ubuf *src_fname; @@ -197,9 +197,10 @@ spooldir_next(struct spooldir *s) goto out; } - ubuf_detach(s->fname, (uint8_t **) &ret, &retsz); + ubuf_detach(s->fname, &ubuf_str, &retsz); out: ubuf_destroy(&src_fname); pthread_mutex_unlock(&s->lock); - return (ret); + + return ((char *)ubuf_str); } diff --git a/string_replace.h b/string_replace.h index 5edc207..2d0ed7d 100644 --- a/string_replace.h +++ b/string_replace.h @@ -27,6 +27,7 @@ string_replace(const char *str, const char *old, const char *new) const char *end; char *ret; size_t retsz; + uint8_t *ubuf_str = NULL; if (strstr(str, old) == NULL) { char *s = strdup(str); @@ -48,9 +49,10 @@ string_replace(const char *str, const char *old, const char *new) ubuf_append(u, (uint8_t *) str, strlen(str)); ubuf_cterm(u); - ubuf_detach(u, (uint8_t **) &ret, &retsz); + ubuf_detach(u, &ubuf_str, &retsz); ubuf_destroy(&u); - return (ret); + + return ((char *)ubuf_str); } #endif /* MY_STRING_REPLACE_H */