more.c:318:5: warning: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
more.c:362:3: warning: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
int main(int argc, char **argv) {
FILE *f;
char *s;
- char *p;
int ch;
int left;
int prnames = 0;
int srchopt = 0;
int clearit = 0;
int initline = 0;
- char initbuf[INIT_BUF];
+ char *initbuf = NULL;
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
s = *fnames;
if (*++s == '/') {
srchopt++;
- for (++s, p = initbuf; p < initbuf + (INIT_BUF - 1) && *s != '\0';)
- *p++ = *s++;
- *p = '\0';
+ initbuf = xstrdup(s + 1);
}
else {
initopt++;
firstf = 0;
}
free (previousre);
+ free (initbuf);
reset_tty ();
exit(EXIT_SUCCESS);
}