Skip to content

Commit a74cede

Browse files
authored
Merge pull request #1 from zonyitoo/cpp0x
[zonyitoo#20] Fixed getopt_long in rpi
2 parents 63ec850 + 330cd74 commit a74cede

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: src/main.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,10 @@ int main(int argc, char *const argv[]) {
9191
eap_method method = EAP_METHOD_XOR;
9292
bool daemon = false;
9393
bool color = false;
94-
char argval;
95-
while ((argval = getopt_long(argc, argv, "u:p:i:m:dhc", arglist, NULL)) != -1) {
94+
int argval = 0;
95+
// XXX: `getopt` and `getopt_long` seems to return an unsigned char value, which is different
96+
// to all the other systems!
97+
while ((argval = getopt_long(argc, argv, "u:p:i:m:dhc", arglist, NULL)) != -1 && argval != 255) {
9698
switch (argval) {
9799
case 'h':
98100
printf("Usage: sysuh3c [arg]\n"

0 commit comments

Comments
 (0)