a few more cleanups, use memcpy instead of strncpy
git-svn-id: https://svn.musicpd.org/mpd/trunk@55 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
1e9b166574
commit
ca3068d411
|
@ -57,7 +57,7 @@ char * convStrDup(char * string) {
|
|||
size_t inleft = strlen(string);
|
||||
char * ret;
|
||||
size_t outleft;
|
||||
int retlen = 0;
|
||||
size_t retlen = 0;
|
||||
size_t err;
|
||||
char * bufferPtr;
|
||||
|
||||
|
@ -76,7 +76,7 @@ char * convStrDup(char * string) {
|
|||
}
|
||||
|
||||
ret = realloc(ret,retlen+BUFFER_SIZE-outleft+1);
|
||||
strncpy(&(ret[retlen]),buffer,BUFFER_SIZE-outleft);
|
||||
memcpy(&(ret[retlen]),buffer,BUFFER_SIZE-outleft);
|
||||
retlen+=BUFFER_SIZE-outleft;
|
||||
ret[retlen] = '\0';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue