Index: lib/libc/stdio/gets.c =================================================================== --- lib/libc/stdio/gets.c +++ lib/libc/stdio/gets.c @@ -44,36 +44,11 @@ #include "libc_private.h" #include "local.h" -__warn_references(gets, "warning: this program uses gets(), which is unsafe."); +__warn_references(gets, "warning: this program uses gets(), which is unsafe and has been disabled."); char * gets(char *buf) { - int c; - char *s, *ret; - static int warned; - static const char w[] = - "warning: this program uses gets(), which is unsafe.\n"; - FLOCKFILE_CANCELSAFE(stdin); - ORIENT(stdin, -1); - if (!warned) { - (void) _write(STDERR_FILENO, w, sizeof(w) - 1); - warned = 1; - } - for (s = buf; (c = __sgetc(stdin)) != '\n'; ) { - if (c == EOF) - if (s == buf) { - ret = NULL; - goto end; - } else - break; - else - *s++ = c; - } - *s = 0; - ret = buf; -end: - FUNLOCKFILE_CANCELSAFE(); - return (ret); + abort(); }