[syslinux:elflink] ldlinux: Silence gcc warning about uninitialized variable

syslinux-bot for Matt Fleming matt.fleming at intel.com
Tue Apr 17 11:24:14 PDT 2012


Commit-ID:  55891f97921b5e949f1bd1f2983cb964b80028c5
Gitweb:     http://www.syslinux.org/commit/55891f97921b5e949f1bd1f2983cb964b80028c5
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Mon, 2 Apr 2012 14:12:06 +0100
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Tue, 17 Apr 2012 10:58:34 +0100

ldlinux: Silence gcc warning about uninitialized variable

Initialize 'comm_counter' so that gcc will no longer complain with the
following,

cli.c: In function ‘edit_cmdline’:
cli.c:142:25: warning: ‘comm_counter’ may be used uninitialized in this function

Signed-off-by: Matt Fleming <matt.fleming at intel.com>

---
 com32/elflink/ldlinux/cli.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/com32/elflink/ldlinux/cli.c b/com32/elflink/ldlinux/cli.c
index 6d74109..498644e 100644
--- a/com32/elflink/ldlinux/cli.c
+++ b/com32/elflink/ldlinux/cli.c
@@ -139,7 +139,7 @@ const char *edit_cmdline(const char *input, int top /*, int width */ ,
     bool done = false;
     const char *ret;
     int width = 0;
-    struct cli_command *comm_counter;
+    struct cli_command *comm_counter = NULL;
 
     if (!width) {
 	int height;


More information about the Syslinux-commits mailing list