stripbraces(), cleanup

This commit is contained in:
rlar 2017-11-17 17:09:24 +01:00
parent 13be771308
commit 11e024753a
1 changed files with 2 additions and 3 deletions

View File

@ -92,12 +92,11 @@ static int
stripbraces(SPICE_DSTRINGPTR dstr_p) stripbraces(SPICE_DSTRINGPTR dstr_p)
/* puts the funny placeholders. returns the number of {...} substitutions */ /* puts the funny placeholders. returns the number of {...} substitutions */
{ {
int n, nest; int n = 0;
char *s = spice_dstring_value(dstr_p); char *s = spice_dstring_value(dstr_p);
char *p, *brace; char *p, *brace;
SPICE_DSTRING tstr; /* temporary dynamic string */ SPICE_DSTRING tstr; /* temporary dynamic string */
n = 0;
spice_dstring_init(&tstr); spice_dstring_init(&tstr);
p = s; p = s;
@ -105,7 +104,7 @@ stripbraces(SPICE_DSTRINGPTR dstr_p)
/* something to strip */ /* something to strip */
const char *j_ptr = brace + 1; const char *j_ptr = brace + 1;
nest = 1; int nest = 1;
n++; n++;
while ((nest > 0) && *j_ptr) { while ((nest > 0) && *j_ptr) {