summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall
diff options
context:
space:
mode:
authorkevlo <kevlo@FreeBSD.org>2007-03-06 09:32:41 +0000
committerkevlo <kevlo@FreeBSD.org>2007-03-06 09:32:41 +0000
commit8c9d3c018a54e0300ee146ffce11fdf43d7ee41b (patch)
treedd4b53875b60e23b434e53c7d430da63fdeb7bcb /usr.sbin/sysinstall
parente5953785d06c108599cb30d8a2cfe0c8b6419ef0 (diff)
downloadFreeBSD-src-8c9d3c018a54e0300ee146ffce11fdf43d7ee41b.zip
FreeBSD-src-8c9d3c018a54e0300ee146ffce11fdf43d7ee41b.tar.gz
Use sizeof() for calculating the buffer size instead of hard-coded values.
Diffstat (limited to 'usr.sbin/sysinstall')
-rw-r--r--usr.sbin/sysinstall/termcap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/sysinstall/termcap.c b/usr.sbin/sysinstall/termcap.c
index 1d8e047..ca5905a 100644
--- a/usr.sbin/sysinstall/termcap.c
+++ b/usr.sbin/sysinstall/termcap.c
@@ -50,7 +50,7 @@ prompt_term(char **termp, char **termcapp)
printf("5 ...................... xterm terminal emulator.\n\n");
printf("Your choice: (1-5) ");
fflush(stdout);
- fgets(str, 80, stdin);
+ fgets(str, sizeof(str), stdin);
i = str[0] - '0';
if (i > 0 && i < 6) {
*termp = (char *)lookup[i - 1].term;
@@ -64,7 +64,7 @@ prompt_term(char **termp, char **termcapp)
else {
printf("\nPlease set your TERM variable before running this program.\n");
printf("Defaulting to an ANSI compatible terminal - please press RETURN\n");
- fgets(str, 80, stdin); /* Just to make it interactive */
+ fgets(str, sizeof(str), stdin); /* Just to make it interactive */
*termp = (char *)"ansi";
*termcapp = (char *)termcap_ansi;
}
OpenPOWER on IntegriCloud