summaryrefslogtreecommitdiff
path: root/usr.bin/window/wwterminfo.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-03-17 04:11:56 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-03-17 04:11:56 +0000
commit48a3d091978f3f1ef6abc0858ec97d4988d5bb24 (patch)
treeeed127d41a8063f3f0502854d0394a8b5f191d87 /usr.bin/window/wwterminfo.c
parent8d16e2b2bf113a054616db0b39384e5280b61ff9 (diff)
do some snprintf, because i am a bit bored
Diffstat (limited to 'usr.bin/window/wwterminfo.c')
-rw-r--r--usr.bin/window/wwterminfo.c17
1 files changed, 9 insertions, 8 deletions
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;
}