From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 5792713864A for ; Thu, 24 Jan 2013 10:15:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5A91EE0743; Thu, 24 Jan 2013 10:15:11 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E566BE0743 for ; Thu, 24 Jan 2013 10:15:10 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E784633DAB3 for ; Thu, 24 Jan 2013 10:15:09 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 7D770E4079 for ; Thu, 24 Jan 2013 10:15:07 +0000 (UTC) From: "Sven Eden" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sven Eden" Message-ID: <1359022103.b14f6eceb178d3a95eeba27fe7c26a0081e8b4d3.yamakuzure@gentoo> Subject: [gentoo-commits] proj/ufed:master commit in: / X-VCS-Repository: proj/ufed X-VCS-Files: ufed-curses-help.c X-VCS-Directories: / X-VCS-Committer: yamakuzure X-VCS-Committer-Name: Sven Eden X-VCS-Revision: b14f6eceb178d3a95eeba27fe7c26a0081e8b4d3 X-VCS-Branch: master Date: Thu, 24 Jan 2013 10:15:07 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 2582f0a6-6f45-4ee3-b825-605536d84773 X-Archives-Hash: 26339521e7d7a5d2a5912fc5bcb4fc23 commit: b14f6eceb178d3a95eeba27fe7c26a0081e8b4d3 Author: Sven Eden gmx de> AuthorDate: Thu Jan 24 10:08:23 2013 +0000 Commit: Sven Eden gmx de> CommitDate: Thu Jan 24 10:08:23 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/ufed.git;a=commit;h=b14f6ece Add missing comments and initializations to the help lines. --- ufed-curses-help.c | 21 +++++++++++++++++---- 1 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ufed-curses-help.c b/ufed-curses-help.c index 3803144..62835f9 100644 --- a/ufed-curses-help.c +++ b/ufed-curses-help.c @@ -11,13 +11,23 @@ #include #include +/* internal types */ static struct line { struct item item; char *text; } *lines; + +/* internal members */ static int helpheight, helpwidth; +/* external members */ +extern enum mask showMasked; +extern enum scope showScope; + +/* internal prototypes */ static void free_lines(void); + +/* function implementations */ static void init_lines(void) { static const char * const help[] = { "ufed is a simple program designed to help you configure the systems USE " @@ -110,7 +120,7 @@ static void init_lines(void) { for(;;) { line = malloc(sizeof *line); if(line==NULL) - exit(-1); + ERROR_EXIT(-1, "Can not allocate %lu bytes for help line struct\n", sizeof(*line)); if(lines==NULL) { line->item.prev = (struct item *) line; line->item.next = (struct item *) line; @@ -121,6 +131,10 @@ static void init_lines(void) { lines->item.prev->next = (struct item *) line; lines->item.prev = (struct item *) line; } + + line->item.currline = 0; + line->item.isMasked = false; + line->item.isGlobal = true; line->item.listline = y++; line->item.ndescr = 1; n = strlen(word); @@ -132,11 +146,10 @@ static void init_lines(void) { } } } - line->text = malloc(n+1); + line->text = calloc((n+1), sizeof(char)); if(line->text==NULL) - exit(-1); + ERROR_EXIT(-1, "Can not allocate %lu bytes for help line\n", (n+1) * sizeof(char)); memcpy(line->text, word, n); - line->text[n] = '\0'; while(word[n]==' ') n++; word += n;