Fix getopt usage
authorWouter Verhelst <w@uter.be>
Sun, 13 Feb 2011 10:17:47 +0000 (11:17 +0100)
committerWouter Verhelst <w@uter.be>
Sun, 13 Feb 2011 10:17:47 +0000 (11:17 +0100)
getopt returns an int, not a char. Since char is unsigned by default on
some architectures, this caused an infinite loop in option parsing
there.

nbd-tester-client.c

index 37981c4..d52b687 100644 (file)
@@ -396,7 +396,7 @@ int main(int argc, char**argv) {
        long int p = 0;
        char* name = NULL;
        int sock=0;
-       char c;
+       int c;
        bool want_port = TRUE;
        int nonopt=0;
        testfunc test = throughput_test;