Permalink
Browse files

Silence warnings

Both Clang 2.1 and GCC 4.2.1 warn about using an assignment as a
boolean condition without wrapping it into parentheses.
  • Loading branch information...
1 parent 137a46a commit be0537f1b11e06f1b43685476d5dff5607854487 @jvirtanen jvirtanen committed Jun 8, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/watch.c
View
@@ -113,7 +113,7 @@ int
length(char **strs) {
int n = 0;
char *str;
- while (str = *strs++) n += strlen(str);
+ while ((str = *strs++)) n += strlen(str);
return n + 1;
}
@@ -126,7 +126,7 @@ join(char **strs, int len, char *val) {
--len;
char *buf = malloc(length(strs) + len * strlen(val));
char *str;
- while (str = *strs++) {
+ while ((str = *strs++)) {
strcat(buf, str);
if (*strs) strcat(buf, val);
}

0 comments on commit be0537f

Please sign in to comment.