aboutsummaryrefslogtreecommitdiffstats
path: root/common/main.c
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2020-10-01 04:25:54 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2020-10-01 04:25:54 +0000
commitb4ed613595432ece6802d09bfabad18e09aa26f3 (patch)
treebd2db6b09b756624c1b2babdd12ea05a9dffcdaf /common/main.c
parent7cef6c685d23e4dcdf3f64b0b2ea92151e652db6 (diff)
downloadsrc-vendor/nvi.tar.gz
src-vendor/nvi.zip
Import nvi 2.2.0-05ed8b9vendor/nvi/2.2.0-05ed8b9vendor/nvi
This snapshot just brings a bunch of fixes in particular a fix for vi -w PR: 241985 Reported by: fernape
Notes
Notes: svn path=/vendor/nvi/dist/; revision=366307 svn path=/vendor/nvi/2.2.0-05ed8b9/; revision=366308; tag=vendor/nvi/2.2.0-05ed8b9
Diffstat (limited to 'common/main.c')
-rw-r--r--common/main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/common/main.c b/common/main.c
index c0b81960bd55..a7e60f1af806 100644
--- a/common/main.c
+++ b/common/main.c
@@ -48,8 +48,8 @@ editor(GS *gp, int argc, char *argv[])
size_t len;
u_int flags;
int ch, flagchk, lflag, secure, startup, readonly, rval, silent;
- char *tag_f, *wsizearg, path[256];
- CHAR_T *w;
+ char *tag_f, *wsizearg;
+ CHAR_T *w, path[256];
size_t wlen;
/* Initialize the busy routine, if not defined by the screen. */
@@ -242,9 +242,9 @@ editor(GS *gp, int argc, char *argv[])
}
if (wsizearg != NULL) {
ARGS *av[2], a, b;
- (void)snprintf(path, sizeof(path), "window=%s", wsizearg);
+ (void)SPRINTF(path, SIZE(path), L("window=%s"), wsizearg);
a.bp = (CHAR_T *)path;
- a.len = strlen(path);
+ a.len = SIZE(path);
b.bp = NULL;
b.len = 0;
av[0] = &a;
@@ -533,7 +533,7 @@ v_obsolete(char *argv[])
argv[0][1] = 'c';
(void)strlcpy(argv[0] + 2, p + 1, len);
}
- } else if (argv[0][0] == '-')
+ } else if (argv[0][0] == '-') {
if (argv[0][1] == '\0') {
argv[0] = strdup("-s");
if (argv[0] == NULL) {
@@ -545,6 +545,7 @@ nomem: warn(NULL);
argv[0][1] == 't' || argv[0][1] == 'w') &&
argv[0][2] == '\0')
++argv;
+ }
return (0);
}