From 2e5c11c04c4db962aebf4b8632ce35a46434cd12 Mon Sep 17 00:00:00 2001 From: Chris Sharp Date: Tue, 19 Sep 2017 18:10:00 -0400 Subject: [PATCH] LP#1243841 - Wrap truth test using "=" in an extra set of parens. Referring to https://stackoverflow.com/questions/5476759/compiler-warning-suggest-parentheses-around-assignment-used-as-truth-value, it is recommended to wrap variable assignments that are used as a truth test within an extra set of parentheses. Signed-off-by: Chris Sharp Signed-off-by: Jason Stephenson Signed-off-by: Galen Charlton --- src/libopensrf/osrf_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libopensrf/osrf_cache.c b/src/libopensrf/osrf_cache.c index 2f829cc..b9ef6e9 100644 --- a/src/libopensrf/osrf_cache.c +++ b/src/libopensrf/osrf_cache.c @@ -60,7 +60,7 @@ char* _clean_key( const char* key ) { char* clean_key = (char*)strdup(key); char* d = clean_key; char* s = clean_key; - do while(isspace(*s) || ((*s != '\0') && iscntrl(*s))) s++; while(*d++ = *s++); + do while( (isspace(*s) || ((*s != '\0') && iscntrl(*s))) ) s++; while( (*d++ = *s++) ); if (strlen(clean_key) > MAX_KEY_LEN) { char *hashed = md5sum(clean_key); clean_key[0] = '\0'; -- 2.43.2