Replace unsafe use of gets()
authorMarc Dionne <marc.c.dionne@gmail.com>
Tue, 13 Apr 2010 23:35:39 +0000 (19:35 -0400)
committerDerrick Brashear <shadow@dementia.org>
Thu, 15 Apr 2010 02:18:39 +0000 (19:18 -0700)
Build tools compain that this is dangerous - replace gets() with a
bounded fgets().

Change-Id: I3bd1854a1dc4a11c801cabb987ab680fa978bd20
Reviewed-on: http://gerrit.openafs.org/1750
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/tviced/state_analyzer.c

index faf571a..d3bfd38 100644 (file)
@@ -368,7 +368,7 @@ prompt(void)
                fprintf(stderr, "prompt state broken; aborting\n");
                return;
            }
-           gets(input);
+           fgets(input, 256, stdin);
 
            if (!strcmp(input, "")) {
                /* repeat last command */