Module Name: src Committed By: dholland Date: Sat Jun 11 06:20:11 UTC 2016
Modified Files: src/sys/arch/hp300/stand/common: netio.c src/sys/arch/hp300/stand/inst: inst.c src/sys/arch/i386/stand/lib: bootmenu.c menuutils.c src/sys/arch/mvme68k/stand/bootst: boot.c src/sys/lib/libsa: gets.c stand.h Log Message: gets_s -> kgets. The exact name isn't that important; but it is important not to use "gets_s" and thereby allow anyone to falsely get the impression we're implementing Annex K. We aren't. ok core. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/arch/hp300/stand/common/netio.c cvs rdiff -u -r1.21 -r1.22 src/sys/arch/hp300/stand/inst/inst.c cvs rdiff -u -r1.15 -r1.16 src/sys/arch/i386/stand/lib/bootmenu.c cvs rdiff -u -r1.5 -r1.6 src/sys/arch/i386/stand/lib/menuutils.c cvs rdiff -u -r1.9 -r1.10 src/sys/arch/mvme68k/stand/bootst/boot.c cvs rdiff -u -r1.12 -r1.13 src/sys/lib/libsa/gets.c cvs rdiff -u -r1.80 -r1.81 src/sys/lib/libsa/stand.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/hp300/stand/common/netio.c diff -u src/sys/arch/hp300/stand/common/netio.c:1.15 src/sys/arch/hp300/stand/common/netio.c:1.16 --- src/sys/arch/hp300/stand/common/netio.c:1.15 Sun Jun 5 17:43:02 2016 +++ src/sys/arch/hp300/stand/common/netio.c Sat Jun 11 06:20:11 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: netio.c,v 1.15 2016/06/05 17:43:02 christos Exp $ */ +/* $NetBSD: netio.c,v 1.16 2016/06/11 06:20:11 dholland Exp $ */ /*- * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. @@ -169,7 +169,7 @@ netmountroot(struct open_file *f, char * get_my_ip: printf("My IP address? "); memset(input_line, 0, sizeof(input_line)); - gets_s(input_line, sizeof(input_line)); + kgets(input_line, sizeof(input_line)); if ((myip.s_addr = inet_addr(input_line)) == htonl(INADDR_NONE)) { printf("invalid IP address: %s\n", input_line); @@ -179,7 +179,7 @@ netmountroot(struct open_file *f, char * get_my_netmask: printf("My netmask? "); memset(input_line, 0, sizeof(input_line)); - gets_s(input_line, sizeof(input_line)); + kgets(input_line, sizeof(input_line)); if ((netmask = inet_addr(input_line)) == htonl(INADDR_NONE)) { printf("invalid netmask: %s\n", input_line); @@ -189,7 +189,7 @@ netmountroot(struct open_file *f, char * get_my_gateway: printf("My gateway? "); memset(input_line, 0, sizeof(input_line)); - gets_s(input_line, sizeof(input_line)); + kgets(input_line, sizeof(input_line)); if ((gateip.s_addr = inet_addr(input_line)) == htonl(INADDR_NONE)) { printf("invalid IP address: %s\n", input_line); @@ -199,7 +199,7 @@ netmountroot(struct open_file *f, char * get_server_ip: printf("Server IP address? "); memset(input_line, 0, sizeof(input_line)); - gets_s(input_line, sizeof(input_line)); + kgets(input_line, sizeof(input_line)); if ((rootip.s_addr = inet_addr(input_line)) == htonl(INADDR_NONE)) { printf("invalid IP address: %s\n", input_line); @@ -209,7 +209,7 @@ netmountroot(struct open_file *f, char * get_server_path: printf("Server path? "); memset(rootpath, 0, sizeof(rootpath)); - gets_s(rootpath, sizeof(rootpath)); + kgets(rootpath, sizeof(rootpath)); if (rootpath[0] == '\0' || rootpath[0] == '\n') goto get_server_path; Index: src/sys/arch/hp300/stand/inst/inst.c diff -u src/sys/arch/hp300/stand/inst/inst.c:1.21 src/sys/arch/hp300/stand/inst/inst.c:1.22 --- src/sys/arch/hp300/stand/inst/inst.c:1.21 Sun Jun 5 17:44:40 2016 +++ src/sys/arch/hp300/stand/inst/inst.c Sat Jun 11 06:20:11 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: inst.c,v 1.21 2016/06/05 17:44:40 christos Exp $ */ +/* $NetBSD: inst.c,v 1.22 2016/06/11 06:20:11 dholland Exp $ */ /*- * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. @@ -131,7 +131,7 @@ main(void) for (;;) { printf("sys_inst> "); memset(line, 0, sizeof(line)); - gets_s(line, sizeof(line)); + kgets(line, sizeof(line)); if (line[0] == '\n' || line[0] == '\0') continue; @@ -200,7 +200,7 @@ dsklabel(void) disklabel_loop: memset(line, 0, sizeof(line)); printf("(z)ap, (e)dit, (s)how, (w)rite, (d)one > "); - gets_s(line, sizeof(line)); + kgets(line, sizeof(line)); if (line[0] == '\n' || line[0] == '\0') goto disklabel_loop; @@ -259,28 +259,28 @@ dsklabel(void) #define GETNUM(out, num) \ printf((out), (num)); \ memset(line, 0, sizeof(line)); \ - gets_s(line, sizeof(line)); \ + kgets(line, sizeof(line)); \ if (line[0]) \ (num) = atoi(line); #define GETNUM2(out, num1, num2) \ printf((out), (num1), (num2)); \ memset(line, 0, sizeof(line)); \ - gets_s(line, sizeof(line)); \ + kgets(line, sizeof(line)); \ if (line[0]) \ (num2) = atoi(line); #define GETSTR(out, str) \ printf((out), (str)); \ memset(line, 0, sizeof(line)); \ - gets_s(line, sizeof(line)); \ + kgets(line, sizeof(line)); \ if (line[0]) \ strcpy((str), line); #define FLAGS(out, flag) \ printf((out), lp->d_flags & (flag) ? 'y' : 'n'); \ memset(line, 0, sizeof(line)); \ - gets_s(line, sizeof(line)); \ + kgets(line, sizeof(line)); \ if (line[0] == 'y' || line[0] == 'Y') \ lp->d_flags |= (flag); \ else \ @@ -514,7 +514,7 @@ opendisk(char *question, char *diskname, printf("%s ", question); memset(diskname, 0, len); memset(fulldiskname, 0, sizeof(fulldiskname)); - gets_s(diskname, sizeof(diskname)); + kgets(diskname, sizeof(diskname)); if (diskname[0] == '\n' || diskname[0] == '\0') goto getdiskname; @@ -570,7 +570,7 @@ miniroot(void) getsource: printf("Source? (N)FS, (t)ape, (d)one > "); memset(line, 0, sizeof(line)); - gets_s(line, sizeof(line)); + kgets(line, sizeof(line)); if (line[0] == '\0') goto getsource; @@ -581,7 +581,7 @@ miniroot(void) printf("Name of miniroot file? "); memset(line, 0, sizeof(line)); memset(minirootname, 0, sizeof(minirootname)); - gets_s(line, sizeof(line)); + kgets(line, sizeof(line)); if (line[0] == '\0') goto name_of_nfs_miniroot; (void)strcat(minirootname, "le0a:"); @@ -613,7 +613,7 @@ miniroot(void) memset(line, 0, sizeof(line)); memset(minirootname, 0, sizeof(minirootname)); memset(tapename, 0, sizeof(tapename)); - gets_s(line, sizeof(line)); + kgets(line, sizeof(line)); if (line[0] == '\0') goto name_of_tape_miniroot; strcat(minirootname, line); @@ -621,7 +621,7 @@ miniroot(void) printf("File number (first == 1)? "); memset(line, 0, sizeof(line)); - gets_s(line, sizeof(line)); + kgets(line, sizeof(line)); fileno = a2int(line); if (fileno < 1 || fileno > 8) { printf("Invalid file number: %s\n", line); @@ -643,7 +643,7 @@ miniroot(void) ignoreshread = 0; printf("Copy how many %d byte blocks? ", DEV_BSIZE); memset(line, 0, sizeof(line)); - gets_s(line, sizeof(line)); + kgets(line, sizeof(line)); nblks = a2int(line); if (nblks < 0) { printf("Invalid block count: %s\n", line); @@ -723,7 +723,7 @@ bootmini(void) printf("Disk to boot from? "); memset(diskname, 0, sizeof(diskname)); memset(bootname, 0, sizeof(bootname)); - gets_s(diskname, sizeof(diskname)); + kgets(diskname, sizeof(diskname)); if (diskname[0] == '\n' || diskname[0] == '\0') goto getdiskname; Index: src/sys/arch/i386/stand/lib/bootmenu.c diff -u src/sys/arch/i386/stand/lib/bootmenu.c:1.15 src/sys/arch/i386/stand/lib/bootmenu.c:1.16 --- src/sys/arch/i386/stand/lib/bootmenu.c:1.15 Sun Jun 5 13:33:03 2016 +++ src/sys/arch/i386/stand/lib/bootmenu.c Sat Jun 11 06:20:11 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: bootmenu.c,v 1.15 2016/06/05 13:33:03 maxv Exp $ */ +/* $NetBSD: bootmenu.c,v 1.16 2016/06/11 06:20:11 dholland Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -178,7 +178,7 @@ doboottypemenu(void) printf("\nOption: [%d]:", bootcfg_info.def + 1); - gets_s(input, sizeof(input)); + kgets(input, sizeof(input)); choice = getchoicefrominput(input, bootcfg_info.def); } else if (bootcfg_info.timeout == 0) choice = bootcfg_info.def; Index: src/sys/arch/i386/stand/lib/menuutils.c diff -u src/sys/arch/i386/stand/lib/menuutils.c:1.5 src/sys/arch/i386/stand/lib/menuutils.c:1.6 --- src/sys/arch/i386/stand/lib/menuutils.c:1.5 Sun Jun 5 13:33:03 2016 +++ src/sys/arch/i386/stand/lib/menuutils.c Sat Jun 11 06:20:11 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: menuutils.c,v 1.5 2016/06/05 13:33:03 maxv Exp $ */ +/* $NetBSD: menuutils.c,v 1.6 2016/06/11 06:20:11 dholland Exp $ */ /* * Copyright (c) 1996, 1997 @@ -71,7 +71,7 @@ bootmenu(void) input[0] = '\0'; printf("> "); - gets_s(input, sizeof(input)); + kgets(input, sizeof(input)); /* * Skip leading whitespace. Index: src/sys/arch/mvme68k/stand/bootst/boot.c diff -u src/sys/arch/mvme68k/stand/bootst/boot.c:1.9 src/sys/arch/mvme68k/stand/bootst/boot.c:1.10 --- src/sys/arch/mvme68k/stand/bootst/boot.c:1.9 Sun Jun 5 17:37:36 2016 +++ src/sys/arch/mvme68k/stand/bootst/boot.c Sat Jun 11 06:20:11 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.9 2016/06/05 17:37:36 christos Exp $ */ +/* $NetBSD: boot.c,v 1.10 2016/06/11 06:20:11 dholland Exp $ */ /*- * Copyright (c) 1982, 1986, 1990, 1993 @@ -62,7 +62,7 @@ main(void) if (flag & RB_ASKNAME) { printf("tapeboot: segment? [%s] ", defname); - gets_s(line, sizeof(line)); + kgets(line, sizeof(line)); if (line[0]) file = line; } Index: src/sys/lib/libsa/gets.c diff -u src/sys/lib/libsa/gets.c:1.12 src/sys/lib/libsa/gets.c:1.13 --- src/sys/lib/libsa/gets.c:1.12 Sun Jun 5 15:05:49 2016 +++ src/sys/lib/libsa/gets.c Sat Jun 11 06:20:11 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: gets.c,v 1.12 2016/06/05 15:05:49 christos Exp $ */ +/* $NetBSD: gets.c,v 1.13 2016/06/11 06:20:11 dholland Exp $ */ /*- * Copyright (c) 1993 @@ -36,11 +36,11 @@ void gets(char *buf) { - gets_s(buf, (size_t)-1); + kgets(buf, (size_t)-1); } void -gets_s(char *buf, size_t size) +kgets(char *buf, size_t size) { int c; char *lp; Index: src/sys/lib/libsa/stand.h diff -u src/sys/lib/libsa/stand.h:1.80 src/sys/lib/libsa/stand.h:1.81 --- src/sys/lib/libsa/stand.h:1.80 Sun Jun 5 13:33:03 2016 +++ src/sys/lib/libsa/stand.h Sat Jun 11 06:20:11 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: stand.h,v 1.80 2016/06/05 13:33:03 maxv Exp $ */ +/* $NetBSD: stand.h,v 1.81 2016/06/11 06:20:11 dholland Exp $ */ /* * Copyright (c) 1999 Christopher G. Demetriou. All rights reserved. @@ -78,7 +78,7 @@ #ifdef LIBSA_RENAME_PRINTF #define getchar libsa_getchar #define gets libsa_gets -#define gets_s libsa_gets_s +#define kgets libsa_kgets #define printf libsa_printf #define putchar libsa_putchar #define vprintf libsa_vprintf @@ -259,7 +259,7 @@ int vsnprintf(char *, size_t, const char __attribute__((__format__(__printf__, 3, 0))); void twiddle(void); void gets(char *); -void gets_s(char *, size_t); +void kgets(char *, size_t); int getfile(char *prompt, int mode); char *strerror(int); __dead void exit(int);