summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/window/error.c6
-rw-r--r--usr.bin/window/wwenviron.c8
-rw-r--r--usr.bin/window/wwterminfo.c17
3 files changed, 16 insertions, 15 deletions
diff --git a/usr.bin/window/error.c b/usr.bin/window/error.c
index 9a4421dbc7b..5ce307ead85 100644
--- a/usr.bin/window/error.c
+++ b/usr.bin/window/error.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: error.c,v 1.3 1997/02/25 00:04:04 downsj Exp $ */
+/* $OpenBSD: error.c,v 1.4 1998/03/17 04:11:53 deraadt Exp $ */
/* $NetBSD: error.c,v 1.3 1995/09/28 10:34:20 tls Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)error.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: error.c,v 1.3 1997/02/25 00:04:04 downsj Exp $";
+static char rcsid[] = "$OpenBSD: error.c,v 1.4 1998/03/17 04:11:53 deraadt Exp $";
#endif
#endif /* not lint */
@@ -75,7 +75,7 @@ char *fmt;
if ((w = x->x_errwin) == 0) {
char buf[512];
- (void) sprintf(buf, "Errors from %s", x->x_filename);
+ (void) snprintf(buf, sizeof buf, "Errors from %s", x->x_filename);
if ((w = x->x_errwin = openiwin(ERRLINES, buf)) == 0) {
wwputs("Can't open error window. ", cmdwin);
x->x_noerr = 1;
diff --git a/usr.bin/window/wwenviron.c b/usr.bin/window/wwenviron.c
index 1e338d63f04..677154d5b70 100644
--- a/usr.bin/window/wwenviron.c
+++ b/usr.bin/window/wwenviron.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wwenviron.c,v 1.4 1997/02/25 00:04:50 downsj Exp $ */
+/* $OpenBSD: wwenviron.c,v 1.5 1998/03/17 04:11:54 deraadt Exp $ */
/* $NetBSD: wwenviron.c,v 1.4 1995/12/21 08:39:50 mycroft Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)wwenviron.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: wwenviron.c,v 1.4 1997/02/25 00:04:50 downsj Exp $";
+static char rcsid[] = "$OpenBSD: wwenviron.c,v 1.5 1998/03/17 04:11:54 deraadt Exp $";
#endif
#endif /* not lint */
@@ -99,10 +99,10 @@ register struct ww *wp;
* 1. setenv() copies the string,
* 2. we've already called tgetent which copies the termcap entry.
*/
- (void) sprintf(buf, "%sco#%d:li#%d:%s",
+ (void) snprintf(buf, sizeof buf, "%sco#%d:li#%d:%s",
WWT_TERMCAP, wp->ww_w.nc, wp->ww_w.nr, wwwintermcap);
(void) setenv("TERMCAP", buf, 1);
- (void) sprintf(buf, "%d", wp->ww_id + 1);
+ (void) snprintf(buf, sizeof buf, "%d", wp->ww_id + 1);
(void) setenv("WINDOW_ID", buf, 1);
return 0;
bad:
diff --git a/usr.bin/window/wwterminfo.c b/usr.bin/window/wwterminfo.c
index 57ee2184b89..6b3b0694762 100644
--- a/usr.bin/window/wwterminfo.c
+++ b/usr.bin/window/wwterminfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wwterminfo.c,v 1.6 1998/01/03 12:32:23 deraadt Exp $ */
+/* $OpenBSD: wwterminfo.c,v 1.7 1998/03/17 04:11:55 deraadt Exp $ */
/*
* Copyright (c) 1982, 1993
@@ -40,7 +40,7 @@
#if 0
static char sccsid[] = "@(#)wwterminfo.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: wwterminfo.c,v 1.6 1998/01/03 12:32:23 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: wwterminfo.c,v 1.7 1998/03/17 04:11:55 deraadt Exp $";
#endif
#endif /* not lint */
@@ -68,7 +68,8 @@ wwterminfoinit()
char buf[2048];
/* make the directory */
- (void) sprintf(wwterminfopath, "%swwinXXXXXX", _PATH_TMP);
+ (void) snprintf(wwterminfopath, sizeof wwterminfopath,
+ "%swwinXXXXXX", _PATH_TMP);
mktemp(wwterminfopath);
if (mkdir(wwterminfopath, 0755) < 0 ||
chmod(wwterminfopath, 00755) < 0) {
@@ -77,7 +78,7 @@ wwterminfoinit()
}
(void) setenv("TERMINFO", wwterminfopath, 1);
/* make a termcap entry and turn it into terminfo */
- (void) sprintf(buf, "%s/cap", wwterminfopath);
+ (void) snprintf(buf, sizeof buf, "%s/cap", wwterminfopath);
if ((fp = fopen(buf, "w")) == NULL) {
wwerrno = WWE_SYS;
return -1;
@@ -85,10 +86,10 @@ wwterminfoinit()
(void) fprintf(fp, "%sco#%d:li#%d:%s\n",
WWT_TERMCAP, wwncol, wwnrow, wwwintermcap);
(void) fclose(fp);
- (void) sprintf(buf,
- "cd %s; %s cap >info 2>/dev/null; %s info >/dev/null 2>&1",
- wwterminfopath, _PATH_CAPTOINFO, _PATH_TIC);
- (void) system(buf);
+ (void) snprintf(buf, sizeof buf,
+ "cd %s; %s cap >info 2>/dev/null; %s info >/dev/null 2>&1",
+ wwterminfopath, _PATH_CAPTOINFO, _PATH_TIC);
+ (void) system(buf); /* XXX */
return 0;
}