aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-06-12 02:06:16 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-06-12 02:06:16 +0000
commit43b355734cf192129f2906789185301a61f4cd8a (patch)
tree35a3a56a085fc590b1864347d49660d421157305 /src/utils.c
parent43255a7f63af65d88bbead4c0d6429ef2008ada8 (diff)
downloadmpd-43b355734cf192129f2906789185301a61f4cd8a.tar.gz
mpd-43b355734cf192129f2906789185301a61f4cd8a.tar.xz
mpd-43b355734cf192129f2906789185301a61f4cd8a.zip
Add WARNING log method. it's the same as ERROR, except that when mpd starts,
warnings are buffered until the error log is opened, and then flushed to the error log. git-svn-id: https://svn.musicpd.org/mpd/trunk@1442 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/utils.c b/src/utils.c
index ece410b2c..fbcf3d9dd 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -70,4 +70,22 @@ int ipv6Supported() {
return 0;
}
-/* vim:set shiftwidth=4 tabstop=8 expandtab: */
+char * appendToString(char * dest, const char * src) {
+ int destlen;
+ int srclen = strlen(src);
+
+ if(dest == NULL) {
+ dest = malloc(srclen+1);
+ memset(dest, 0, srclen+1);
+ destlen = 0;
+ }
+ else {
+ destlen = strlen(dest);
+ dest = realloc(dest, destlen+srclen+1);
+ }
+
+ memcpy(dest+destlen, src, srclen);
+ dest[destlen+srclen] = '\0';
+
+ return dest;
+}