[PATCH] invutil: fix a gcc warning

Christoph Hellwig hch at infradead.org
Thu Sep 22 11:48:10 CDT 2011


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 at lst.de>

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;




More information about the xfs mailing list