Skip to contentSkip to conversation

f2fstat: Fix option parsing

PATCH New Michael Lass 1 participant 1 message Mar 3, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 f2fstat: Fix option parsing

On systems using unsigned char as default (char)EOF != EOF.
Use int to store returned value of getopt to make it work on all platforms.

---
 tools/f2fstat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/f2fstat.c +1 -1
index 8643797..7f485b0 100644
@@ -191,7 +191,7 @@ void usage(void)
 
 void parse_option(int argc, char *argv[], struct options *opt)
 {
-	char option;
+	int option;
 	const char *option_string = "d:i:p:h";
 
 	while ((option = getopt(argc, argv, option_string)) != EOF) {
Signature · 9 lines
2.3.1


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/