aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-02-25 18:56:12 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-02-25 18:56:12 +0000
commit483d8873bd851abb0db066323e0512e1a22dc840 (patch)
tree21b77a54cd5ad15945582c968e180320fce3b602 /src
parente4f265b2fce5609d4862cd2d42fd58adf7341299 (diff)
downloadmpd-483d8873bd851abb0db066323e0512e1a22dc840.tar.gz
mpd-483d8873bd851abb0db066323e0512e1a22dc840.tar.xz
mpd-483d8873bd851abb0db066323e0512e1a22dc840.zip
few cleanups
git-svn-id: https://svn.musicpd.org/mpd/trunk@57 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src')
-rw-r--r--src/charConv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/charConv.c b/src/charConv.c
index cb8db75c2..6d905bccc 100644
--- a/src/charConv.c
+++ b/src/charConv.c
@@ -63,7 +63,8 @@ char * convStrDup(char * string) {
if(!char_conv_to) return NULL;
- ret = strdup("");
+ ret = malloc(1);
+ ret[0] = '\0';
while(inleft) {
bufferPtr = buffer;
@@ -76,7 +77,7 @@ char * convStrDup(char * string) {
}
ret = realloc(ret,retlen+BUFFER_SIZE-outleft+1);
- memcpy(&(ret[retlen]),buffer,BUFFER_SIZE-outleft);
+ memcpy(ret+retlen,buffer,BUFFER_SIZE-outleft);
retlen+=BUFFER_SIZE-outleft;
ret[retlen] = '\0';
}