diff options
author | Johannes Löthberg <johannes@kyriasis.com> | 2015-01-18 03:59:03 +0100 |
---|---|---|
committer | Johannes Löthberg <johannes@kyriasis.com> | 2015-01-18 03:59:03 +0100 |
commit | f39d638489416a5c408e664733ffbce83c725c57 (patch) | |
tree | de1427da91e5d038aa224963f23b9935991594e6 /src | |
parent | 77b449ebd77d06d51853b615c94a4717cd55c470 (diff) | |
download | sds-f39d638489416a5c408e664733ffbce83c725c57.tar.xz |
sds.c: add braces around naked while loops
Diffstat (limited to 'src')
-rw-r--r-- | src/sds.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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; |