From c558135c63338709ddae3a16e00f0b1670bc887b Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Mon, 15 Nov 2010 19:20:53 +0100 Subject: [PATCH] strbuf.c: move declarations that are not declared at the beginning of a scope block --- src/strbuf.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/strbuf.c b/src/strbuf.c index f0ca42f..fc3ac9f 100644 --- a/src/strbuf.c +++ b/src/strbuf.c @@ -161,20 +161,19 @@ void strbuf_rev(strbuf_t *s) { void strbuf_squeeze(strbuf_t *s, char ch) { - size_t p; + size_t p, np, of; for(p=s->len; p; p--) { if (s->buf[p-1] != ch) continue; - size_t np = p, of = 0; - - for(; np-1 && s->buf[np-2] == ch; np--) + np = p; + + for(of = 0; np-1 && s->buf[np-2] == ch; np--) of++; if (of) { - p = np; for(s->len -= of; np <= s->len; np++) s->buf[np] = s->buf[np + of];