Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/hp300/stand/inst get rid of gets



details:   https://anonhg.NetBSD.org/src/rev/97cfbc9f7467
branches:  trunk
changeset: 815871:97cfbc9f7467
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Jun 05 17:44:40 2016 +0000

description:
get rid of gets

diffstat:

 sys/arch/hp300/stand/inst/inst.c |  28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diffs (123 lines):

diff -r df5463e9ea30 -r 97cfbc9f7467 sys/arch/hp300/stand/inst/inst.c
--- a/sys/arch/hp300/stand/inst/inst.c  Sun Jun 05 17:43:02 2016 +0000
+++ b/sys/arch/hp300/stand/inst/inst.c  Sun Jun 05 17:44:40 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inst.c,v 1.20 2014/08/10 07:40:49 isaki Exp $  */
+/*     $NetBSD: inst.c,v 1.21 2016/06/05 17:44:40 christos Exp $       */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -131,7 +131,7 @@
        for (;;) {
                printf("sys_inst> ");
                memset(line, 0, sizeof(line));
-               gets(line);
+               gets_s(line, sizeof(line));
                if (line[0] == '\n' || line[0] == '\0')
                        continue;
 
@@ -200,7 +200,7 @@
  disklabel_loop:
        memset(line, 0, sizeof(line));
        printf("(z)ap, (e)dit, (s)how, (w)rite, (d)one > ");
-       gets(line);
+       gets_s(line, sizeof(line));
        if (line[0] == '\n' || line[0] == '\0')
                goto disklabel_loop;
 
@@ -259,28 +259,28 @@
 #define GETNUM(out, num)                                               \
        printf((out), (num));                                           \
        memset(line, 0, sizeof(line));                                  \
-       gets(line);                                                     \
+       gets_s(line, sizeof(line));                                                     \
        if (line[0])                                                    \
                (num) = atoi(line);
 
 #define GETNUM2(out, num1, num2)                                       \
        printf((out), (num1), (num2));                                  \
        memset(line, 0, sizeof(line));                                  \
-       gets(line);                                                     \
+       gets_s(line, sizeof(line));                                                     \
        if (line[0])                                                    \
                (num2) = atoi(line);
 
 #define GETSTR(out, str)                                               \
        printf((out), (str));                                           \
        memset(line, 0, sizeof(line));                                  \
-       gets(line);                                                     \
+       gets_s(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(line);                                                     \
+       gets_s(line, sizeof(line));                                                     \
        if (line[0] == 'y' || line[0] == 'Y')                           \
                lp->d_flags |= (flag);                                  \
        else                                                            \
@@ -514,7 +514,7 @@
        printf("%s ", question);
        memset(diskname, 0, len);
        memset(fulldiskname, 0, sizeof(fulldiskname));
-       gets(diskname);
+       gets_s(diskname, sizeof(diskname));
        if (diskname[0] == '\n' || diskname[0] == '\0')
                goto getdiskname;
 
@@ -570,7 +570,7 @@
  getsource:
        printf("Source? (N)FS, (t)ape, (d)one > ");
        memset(line, 0, sizeof(line));
-       gets(line);
+       gets_s(line, sizeof(line));
        if (line[0] == '\0')
                goto getsource;
 
@@ -581,7 +581,7 @@
                printf("Name of miniroot file? ");
                memset(line, 0, sizeof(line));
                memset(minirootname, 0, sizeof(minirootname));
-               gets(line);
+               gets_s(line, sizeof(line));
                if (line[0] == '\0')
                        goto name_of_nfs_miniroot;
                (void)strcat(minirootname, "le0a:");
@@ -613,7 +613,7 @@
                memset(line, 0, sizeof(line));
                memset(minirootname, 0, sizeof(minirootname));
                memset(tapename, 0, sizeof(tapename));
-               gets(line);
+               gets_s(line, sizeof(line));
                if (line[0] == '\0')
                        goto name_of_tape_miniroot;
                strcat(minirootname, line);
@@ -621,7 +621,7 @@
 
                printf("File number (first == 1)? ");
                memset(line, 0, sizeof(line));
-               gets(line);
+               gets_s(line, sizeof(line));
                fileno = a2int(line);
                if (fileno < 1 || fileno > 8) {
                        printf("Invalid file number: %s\n", line);
@@ -643,7 +643,7 @@
                ignoreshread = 0;
                printf("Copy how many %d byte blocks? ", DEV_BSIZE);
                memset(line, 0, sizeof(line));
-               gets(line);
+               gets_s(line, sizeof(line));
                nblks = a2int(line);
                if (nblks < 0) {
                        printf("Invalid block count: %s\n", line);
@@ -723,7 +723,7 @@
        printf("Disk to boot from? ");
        memset(diskname, 0, sizeof(diskname));
        memset(bootname, 0, sizeof(bootname));
-       gets(diskname);
+       gets_s(diskname, sizeof(diskname));
        if (diskname[0] == '\n' || diskname[0] == '\0')
                goto getdiskname;
 



Home | Main Index | Thread Index | Old Index