=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/window/Attic/wwterminfo.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- src/usr.bin/window/Attic/wwterminfo.c 1998/01/03 12:32:23 1.6 +++ src/usr.bin/window/Attic/wwterminfo.c 1998/03/17 04:11:55 1.7 @@ -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 @@ 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 @@ } (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 @@ (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; }