aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2015-01-18 03:59:03 +0100
committerJohannes Löthberg <johannes@kyriasis.com>2015-01-18 03:59:03 +0100
commitf39d638489416a5c408e664733ffbce83c725c57 (patch)
treede1427da91e5d038aa224963f23b9935991594e6 /src
parent77b449ebd77d06d51853b615c94a4717cd55c470 (diff)
downloadsds-f39d638489416a5c408e664733ffbce83c725c57.tar.xz
sds.c: add braces around naked while loops
Diffstat (limited to 'src')
-rw-r--r--src/sds.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sds.c b/src/sds.c
index e396fb1..9f1383e 100644
--- a/src/sds.c
+++ b/src/sds.c
@@ -518,8 +518,9 @@ cleanup:
/* Free the result returned by sdssplitlen(), or do nothing if 'tokens' is NULL. */
void sdsfreesplitres(sds *tokens, int count) {
if (!tokens) return;
- while(count--)
+ while(count--) {
sdsfree(tokens[count]);
+ }
free(tokens);
}
@@ -726,8 +727,9 @@ sds *sdssplitargs(const char *line, int *argc) {
}
err:
- while((*argc)--)
+ while((*argc)--) {
sdsfree(vector[*argc]);
+ }
free(vector);
if (current) sdsfree(current);
*argc = 0;