diff options
author | Indent <please@skip.me> | 2015-02-19 02:47:20 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2015-02-20 19:50:54 -0300 |
commit | 5ebff60479fc7a9f7f50ac03b124c91d4e6ebe11 (patch) | |
tree | 9fc0d50cb1f4bc9768d9f00de94eafd876bb55b0 /protocols/yahoo/yahoo_util.c | |
parent | af359b4316f9d392c6b752495a1b2ed631576ed8 (diff) |
Reindent everything to K&R style with tabs
Used uncrustify, with the configuration file in ./doc/uncrustify.cfg
Commit author set to "Indent <please@skip.me>" so that it's easier to
skip while doing git blame.
Diffstat (limited to 'protocols/yahoo/yahoo_util.c')
-rw-r--r-- | protocols/yahoo/yahoo_util.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/protocols/yahoo/yahoo_util.c b/protocols/yahoo/yahoo_util.c index 1b6168aa..7fc50fda 100644 --- a/protocols/yahoo/yahoo_util.c +++ b/protocols/yahoo/yahoo_util.c @@ -26,10 +26,10 @@ # define strchr index # define strrchr rindex # endif -char *strchr (), *strrchr (); +char *strchr(), *strrchr(); # if !HAVE_MEMCPY -# define memcpy(d, s, n) bcopy ((s), (d), (n)) -# define memmove(d, s, n) bcopy ((s), (d), (n)) +# define memcpy(d, s, n) bcopy((s), (d), (n)) +# define memmove(d, s, n) bcopy((s), (d), (n)) # endif #endif @@ -56,7 +56,8 @@ char *y_string_append(char *string, char *append) void y_strfreev(char ** vector) { char **v; - for(v = vector; *v; v++) { + + for (v = vector; *v; v++) { FREE(*v); } FREE(vector); @@ -66,31 +67,35 @@ char ** y_strsplit(char * str, char * sep, int nelem) { char ** vector; char *s, *p; - int i=0; + int i = 0; int l = strlen(sep); - if(nelem <= 0) { + + if (nelem <= 0) { char * s; - nelem=0; + nelem = 0; if (*str) { - for(s=strstr(str, sep); s; s=strstr(s+l, sep),nelem++) + for (s = strstr(str, sep); s; s = strstr(s + l, sep), nelem++) { ; - if(strcmp(str+strlen(str)-l, sep)) + } + if (strcmp(str + strlen(str) - l, sep)) { nelem++; + } } } vector = y_new(char *, nelem + 1); - for(p=str, s=strstr(p,sep); i<nelem && s; p=s+l, s=strstr(p,sep), i++) { - int len = s-p; - vector[i] = y_new(char, len+1); + for (p = str, s = strstr(p, sep); i < nelem && s; p = s + l, s = strstr(p, sep), i++) { + int len = s - p; + vector[i] = y_new(char, len + 1); strncpy(vector[i], p, len); vector[i][len] = '\0'; } - if(i<nelem && *str) /* str didn't end with sep, and str isn't empty */ + if (i < nelem && *str) { /* str didn't end with sep, and str isn't empty */ vector[i++] = strdup(p); - + } + vector[i] = NULL; return vector; @@ -99,8 +104,10 @@ char ** y_strsplit(char * str, char * sep, int nelem) void * y_memdup(const void * addr, int n) { void * new_chunk = malloc(n); - if(new_chunk) + + if (new_chunk) { memcpy(new_chunk, addr, n); + } return new_chunk; } |