From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason at zx2c4.com (Jason A. Donenfeld) Date: Sun, 7 Apr 2013 15:25:36 +0200 Subject: [PATCH 13/19] ui-snapshot: use a struct strbuf instead of fixed-size buffers In-Reply-To: <8c51155454b9771242d986e10eed00bb0b4b004d.1365326321.git.john@keeping.me.uk> References: <8c51155454b9771242d986e10eed00bb0b4b004d.1365326321.git.john@keeping.me.uk> Message-ID: On Sun, Apr 7, 2013 at 11:30 AM, John Keeping wrote: > + if (prefixcmp(snapshot.buf, reponame) == 0) { > + const char *new_start = snapshot.buf; > + new_start += strlen(reponame); > + while (new_start && (*new_start == '-' || *new_start == '_')) > + new_start++; > + strbuf_splice(&snapshot, 0, new_start - snapshot.buf, "", 0); > } Something funky is happening here.