summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpgen <p.gen.progs@gmail.com>2016-11-29 00:21:46 +0100
committerpgen <p.gen.progs@gmail.com>2016-11-29 00:21:46 +0100
commite2b6d24fb060899b4901c46f9951c509b40cc07a (patch)
treee5b5654fd7bfbf591bf4c53c8c846b84875d34f8
parent7800367741a6d0da6985da7bb8e6f0416080acc3 (diff)
Adjust the code so that it can be compiled with an ansi compiler
-rw-r--r--smenu.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/smenu.c b/smenu.c
index 59655ac..9097aa5 100644
--- a/smenu.c
+++ b/smenu.c
@@ -1405,8 +1405,9 @@ ll_partition(ll_node_t * l, ll_node_t * h, int (*comp) (void *, void *),
void *x = h->data;
ll_node_t *i = l->prev;
+ ll_node_t *j;
- for (ll_node_t * j = l; j != h; j = j->next)
+ for (j = l; j != h; j = j->next)
{
if (comp(j->data, x) < 1)
{
@@ -1657,8 +1658,10 @@ ltrim(char *str, const char *trim_str)
{
size_t len = strlen(str);
size_t begin = strspn(str, trim_str);
+ size_t i;
+
if (begin > 0)
- for (size_t i = begin; i <= len; ++i)
+ for (i = begin; i <= len; ++i)
str[i - begin] = str[i];
}