From patchwork Tue May 25 00:51:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 102073 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4P0pCEg018818 for ; Tue, 25 May 2010 00:51:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757150Ab0EYAvL (ORCPT ); Mon, 24 May 2010 20:51:11 -0400 Received: from trinity.fluff.org ([89.16.178.74]:54931 "EHLO trinity.fluff.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757254Ab0EYAvJ (ORCPT ); Mon, 24 May 2010 20:51:09 -0400 Received: from ben by trinity.fluff.org with local (Exim 4.69) (envelope-from ) id 1OGiMH-0003yj-L6; Tue, 25 May 2010 01:51:01 +0100 From: Ben Dooks To: linux-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org Cc: Ben Dooks Subject: [PATCH 190/190] kbuild: fix unused return value from fgets() Date: Tue, 25 May 2010 01:51:01 +0100 Message-Id: <1274748661-15253-4-git-send-email-ben-linux@fluff.org> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1274748661-15253-1-git-send-email-ben-linux@fluff.org> References: <1274748661-15253-1-git-send-email-ben-linux@fluff.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: ben@trinity.fluff.org X-SA-Exim-Scanned: No (on trinity.fluff.org); SAEximRunCond expanded to false Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 25 May 2010 00:51:12 +0000 (UTC) diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 9960d1c..83c5e24 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -78,6 +78,7 @@ static void check_stdin(void) static int conf_askvalue(struct symbol *sym, const char *def) { enum symbol_type type = sym_get_type(sym); + char *r; if (!sym_has_value(sym)) printf(_("(NEW) ")); @@ -102,7 +103,9 @@ static int conf_askvalue(struct symbol *sym, const char *def) check_stdin(); case ask_all: fflush(stdout); - fgets(line, 128, stdin); + r = fgets(line, 128, stdin); + if (!r) + line[0] = '\0'; return 1; default: break; @@ -259,6 +262,7 @@ static int conf_choice(struct menu *menu) while (1) { int cnt, def; + char *r; printf("%*s%s\n", indent - 1, "", _(menu_get_prompt(menu))); def_sym = sym_get_choice_value(sym); @@ -304,7 +308,9 @@ static int conf_choice(struct menu *menu) check_stdin(); case ask_all: fflush(stdout); - fgets(line, 128, stdin); + r = fgets(line, 128, stdin); + if (!r) + line[0] = '\0'; strip(line); if (line[0] == '?') { print_help(menu);