From 874d317334fae1ddce316f9b6f4d0ce4e434bf52 Mon Sep 17 00:00:00 2001 From: Thomas Ulmer Date: Tue, 23 Jun 2026 21:34:41 -0700 Subject: heirloom vi fixes from arch AUR --- ex_vget.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'ex_vget.c') diff --git a/ex_vget.c b/ex_vget.c index 868c843..4bf2195 100644 --- a/ex_vget.c +++ b/ex_vget.c @@ -317,7 +317,7 @@ again: d = xtoupper(c); else { colp = "({)}!|^~'~"; - while (d = *colp++) + while ((d = *colp++)) if (d == c) { d = *colp++; break; @@ -529,17 +529,17 @@ noteit(int must) { register int sdl = destline, sdc = destcol; - if (notecnt < 2 || !must && state == VISUAL) + if (notecnt < 2 || (!must && state == VISUAL)) return (0); splitw++; if (WBOT == WECHO) vmoveitup(1, 1); vigoto(WECHO, 0); - printf(catgets(catd, 1, 223, "%d %sline"), notecnt, notesgn); + ex_printf(catgets(catd, 1, 223, "%d %sline"), notecnt, notesgn); if (notecnt > 1) putchar('s'); if (*notenam) { - printf(" %s", notenam); + ex_printf(" %s", notenam); if (*(strend(notenam) - 1) != 'e') putchar('e'); putchar('d'); @@ -636,7 +636,7 @@ map(register int c, register struct maps *maps) if (trace) fprintf(trace,"\ntry '%s', ",maps[d].cap); #endif - if (p = maps[d].icap) { + if ((p = maps[d].icap)) { for (q=b; *p; p++, q++) { #ifdef MDEBUG if (trace) @@ -725,13 +725,13 @@ macpush(char *st, int canundo) error(catgets(catd, 1, 224, "Macro too long@ - maybe recursive?")); if (vmacp) { - strcpy(tmpbuf, vmacp); + lcpy(tmpbuf, vmacp, sizeof tmpbuf); if (!FIXUNDO) canundo = 0; /* can't undo inside a macro anyway */ } - strcpy(vmacbuf, st); + lcpy(vmacbuf, st, sizeof vmacbuf); if (vmacp) - strcat(vmacbuf, tmpbuf); + lcat(vmacbuf, tmpbuf, sizeof vmacbuf); vmacp = vmacbuf; /* arrange to be able to undo the whole macro */ if (canundo) { @@ -777,7 +777,7 @@ vudump(char *s) fprintf(trace, " undadot=%d, dot=%d, dol=%d, unddol=%d, truedol=%d\n", lineno(undadot), lineno(dot), lineno(dol), lineno(unddol), lineno(truedol)); fprintf(trace, " [\n"); - CP(savelb, linebuf); + lcpy(savelb, linebuf, sizeof savelb); fprintf(trace, "linebuf = '%s'\n", linebuf); for (p=zero+1; p<=truedol; p++) { fprintf(trace, "%o ", *p); @@ -785,7 +785,7 @@ vudump(char *s) fprintf(trace, "'%s'\n", linebuf); } fprintf(trace, "]\n"); - CP(linebuf, savelb); + lcpy(linebuf, savelb, LBSIZE); } #endif @@ -813,6 +813,7 @@ vgetcnt(void) void trapalarm(int signum) { + (void)signum; alarm(0); if (vcatch) LONGJMP(vreslab,1); -- cgit v1.2.3