From 3b4112ae0ca9835e12ea5142ead10ed0065ec1bb Mon Sep 17 00:00:00 2001 From: cuz Date: Sun, 29 Dec 2002 20:30:09 +0000 Subject: [PATCH] Somewhat shorter code git-svn-id: svn://svn.cc65.org/cc65/trunk@1858 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/common/gets.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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) { -- 2.39.5