diff options
author | Avuton Olrich <avuton@gmail.com> | 2006-07-15 03:34:48 +0000 |
---|---|---|
committer | Avuton Olrich <avuton@gmail.com> | 2006-07-15 03:34:48 +0000 |
commit | 6b4fea8d5ccbdcfb379da2ec512a1d238f459673 (patch) | |
tree | e16a44ef1ec9d7b13e649172cbf65a7a4c14742d /src/utils.c | |
parent | d0c08c52186cd248614585ecee1fe468d5a8417c (diff) | |
download | mpd-6b4fea8d5ccbdcfb379da2ec512a1d238f459673.tar.gz mpd-6b4fea8d5ccbdcfb379da2ec512a1d238f459673.tar.xz mpd-6b4fea8d5ccbdcfb379da2ec512a1d238f459673.zip |
[CLEANUP] Cleanup whitespace->tabs
Remove dead code
Static where possible
git-svn-id: https://svn.musicpd.org/mpd/trunk@4345 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/utils.c')
-rw-r--r-- | src/utils.c | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/src/utils.c b/src/utils.c index 6cc66e379..7dbe88833 100644 --- a/src/utils.c +++ b/src/utils.c @@ -41,9 +41,9 @@ char * myFgets(char * buffer, int bufferSize, FILE * fp) { char * strDupToUpper(char * str) { char * ret = strdup(str); int i; - + for(i=0;i<strlen(str);i++) ret[i] = toupper((int)ret[i]); - + return ret; } @@ -74,29 +74,28 @@ int ipv6Supported() { } 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; + 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; } unsigned long readLEuint32(const unsigned char *p) { return ((unsigned long) p[0] << 0) | - ((unsigned long) p[1] << 8) | - ((unsigned long) p[2] << 16) | ((unsigned long) p[3] << 24); + ((unsigned long) p[1] << 8) | + ((unsigned long) p[2] << 16) | ((unsigned long) p[3] << 24); } - |