xfs
[Top] [All Lists]

[PATCH] invutil: fix a gcc warning

To: xfs@xxxxxxxxxxx
Subject: [PATCH] invutil: fix a gcc warning
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Thu, 22 Sep 2011 12:48:10 -0400
User-agent: Mutt/1.5.21 (2010-09-15)
We never use the lines variable in put_line, except by writing to.  Replace
the fairly ugly getmaxyx macro causing this with the getmaxx call (which
is used by getmaxyx underneath) to only get the number of columns.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Index: xfsdump/invutil/screen.c
===================================================================
--- xfsdump.orig/invutil/screen.c       2011-09-22 12:36:55.445019732 -0400
+++ xfsdump/invutil/screen.c    2011-09-22 12:38:39.272020235 -0400
@@ -27,11 +27,10 @@ put_line(WINDOW *win, int line, char *ms
 {
     int c;
     int cols;
-    int lines;
     int msglen;
     static char text[256];
 
-    getmaxyx(win, lines, cols);
+    cols = getmaxx(win);
     cols--;
     if(cols > 255) {
        cols = 255;

<Prev in Thread] Current Thread [Next in Thread>