From: cuz Date: Sun, 29 Dec 2002 20:30:09 +0000 (+0000) Subject: Somewhat shorter code X-Git-Tag: V2.12.0~1815 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3b4112ae0ca9835e12ea5142ead10ed0065ec1bb;p=cc65 Somewhat shorter code git-svn-id: svn://svn.cc65.org/cc65/trunk@1858 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/libsrc/common/gets.c b/libsrc/common/gets.c index b1872edc3..b9dd00170 100644 --- a/libsrc/common/gets.c +++ b/libsrc/common/gets.c @@ -13,14 +13,13 @@ char* gets (char* s) { - int i, c; + int c; + int i = 0; - i = 0; do { /* Get next character */ - c = fgetc (stdin); - if (c == EOF) { + if ((c = fgetc (stdin)) == EOF) { /* Error or EOF */ s [i] = 0; if (stdin->f_flags & _FERROR) {