summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
8ee0ad0)
Because of the previous change to size_t, when pos == 0 the loop would
wrap around and cause a segmentation fault.
This fixes a regression introduced by
commit
10167cea98f93a74abe63f0a54d3a662997e7489.
assert (g->cmdline_size >= pos);
assert (g->cmdline_size >= pos);
- for (i = g->cmdline_size - 1; i >= pos; --i)
+ for (i = pos; i < g->cmdline_size; ++i)
free (g->cmdline[i]);
g->cmdline_size = pos;
free (g->cmdline[i]);
g->cmdline_size = pos;