--- projects/libstatgrab/src/libstatgrab/tools.c 2004/04/04 23:48:26 1.36 +++ projects/libstatgrab/src/libstatgrab/tools.c 2004/04/04 23:55:48 1.37 @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA * - * $Id: tools.c,v 1.36 2004/04/04 23:48:26 ats Exp $ + * $Id: tools.c,v 1.37 2004/04/04 23:55:48 ats Exp $ */ #ifdef HAVE_CONFIG_H @@ -410,6 +410,19 @@ size_t strlcat(char *dst, const char *src, size_t siz) } #endif + +char *update_string(char **dest, const char *src) { + char *new; + + new = realloc(*dest, strlen(src) + 1); + if (new == NULL) { + return NULL; + } + + strcpy(new, src); + *dest = new; + return new; +} long long get_ll_match(char *line, regmatch_t *match){ char *ptr;