aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils.c
diff options
context:
space:
mode:
authorAvuton Olrich <avuton@gmail.com>2006-07-15 03:34:48 +0000
committerAvuton Olrich <avuton@gmail.com>2006-07-15 03:34:48 +0000
commit6b4fea8d5ccbdcfb379da2ec512a1d238f459673 (patch)
treee16a44ef1ec9d7b13e649172cbf65a7a4c14742d /src/utils.c
parentd0c08c52186cd248614585ecee1fe468d5a8417c (diff)
downloadmpd-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 '')
-rw-r--r--src/utils.c43
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);
}
-