sbase

suckless unix tools
git clone git://git.2f30.org/sbase.git
Log | Files | Refs | README | LICENSE

commit 5a6715c0cf8de7022d7f7c2e0772412518c65356
parent 36dc38acf612250782f9ca55bdef39497d3fe31e
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Fri, 20 Feb 2015 13:26:36 +0100

unexpand: spaces to tabs

Diffstat:
unexpand.c | 26+++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/unexpand.c b/unexpand.c @@ -12,20 +12,20 @@ static int tablistlen = 8; static size_t parselist(const char *s) { - size_t i; - char *p, *tmp; + size_t i; + char *p, *tmp; - tmp = estrdup(s); - for (i = 0; (p = strsep(&tmp, " ,")); i++) { - if (*p == '\0') - eprintf("empty field in tablist\n"); - tablist = erealloc(tablist, (i + 1) * sizeof(*tablist)); - tablist[i] = estrtonum(p, 1, MIN(LLONG_MAX, SIZE_MAX)); - if (i > 0 && tablist[i - 1] >= tablist[i]) - eprintf("tablist must be ascending\n"); - } - tablist = erealloc(tablist, (i + 1) * sizeof(*tablist)); - return i; + tmp = estrdup(s); + for (i = 0; (p = strsep(&tmp, " ,")); i++) { + if (*p == '\0') + eprintf("empty field in tablist\n"); + tablist = erealloc(tablist, (i + 1) * sizeof(*tablist)); + tablist[i] = estrtonum(p, 1, MIN(LLONG_MAX, SIZE_MAX)); + if (i > 0 && tablist[i - 1] >= tablist[i]) + eprintf("tablist must be ascending\n"); + } + tablist = erealloc(tablist, (i + 1) * sizeof(*tablist)); + return i; } static void