summaryrefslogtreecommitdiff
path: root/src/xine-utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/xine-utils')
-rw-r--r--src/xine-utils/utils.c8
-rw-r--r--src/xine-utils/xineutils.h7
2 files changed, 15 insertions, 0 deletions
diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c
index 9f5d122cb..f533d69e5 100644
--- a/src/xine-utils/utils.c
+++ b/src/xine-utils/utils.c
@@ -692,3 +692,11 @@ int xine_monotonic_clock(struct timeval *tv, struct timezone *tz)
#endif
}
+
+char *xine_strcat_realloc (char **dest, char *append)
+{
+ char *newstr = realloc (*dest, (*dest ? strlen (*dest) : 0) + strlen (append) + 1);
+ if (newstr)
+ strcat (*dest = newstr, append);
+ return newstr;
+}
diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h
index 3d630b066..2d6425b00 100644
--- a/src/xine-utils/xineutils.h
+++ b/src/xine-utils/xineutils.h
@@ -969,6 +969,13 @@ const char *xine_guess_spu_encoding(void) XINE_PROTECTED;
*/
int xine_monotonic_clock(struct timeval *tv, struct timezone *tz) XINE_PROTECTED;
+/**
+ * append to a string, reallocating
+ * normally, updates & returns *dest
+ * on error, *dest is unchanged & NULL is returned.
+ */
+char *xine_strcat_realloc (char **dest, char *append) XINE_PROTECTED;
+
/* don't harm following code */
#ifdef extern
# undef extern