commit dabd062b4e97942860055ed1f0887e0b63823913
parent fd4f1616bd5ca5c42fc6448d95151becb11b7bad
Author: Pavel Renev <an2qzavok@gmail.com>
Date: Sun, 5 Sep 2021 21:13:20 +0000
fix menu cutting of end and start letters of entries
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/richterm.c b/richterm.c
@@ -889,17 +889,17 @@ rusergen(int f)
ps = menubuf->p;
for (k = 0, i = 0; (k != f) && (i < menubuf->count); i++) {
if (menubuf->p[i] == '\n') {
- ps = menubuf->p + i;
+ ps = menubuf->p + i + 1;
k++;
}
}
if (k != f) return nil;
- ps++; i++;
+ i++;
for (pe = ps; i < menubuf->count; i++, pe++) {
if (*pe == '\n') break;
}
if (pe == '\0') return nil;
if (ps == pe) return nil;
- memcpy(genbuf, ps, pe - ps - 1);
+ memcpy(genbuf, ps, pe - ps);
return genbuf;
}