Skip to content

Commit

Permalink
[#20] Fixed getopt_long in rpi
Browse files Browse the repository at this point in the history
  • Loading branch information
zonyitoo committed May 7, 2017
1 parent 63ec850 commit 330cd74
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ int main(int argc, char *const argv[]) {
eap_method method = EAP_METHOD_XOR;
bool daemon = false;
bool color = false;
char argval;
while ((argval = getopt_long(argc, argv, "u:p:i:m:dhc", arglist, NULL)) != -1) {
int argval = 0;
// XXX: `getopt` and `getopt_long` seems to return an unsigned char value, which is different
// to all the other systems!
while ((argval = getopt_long(argc, argv, "u:p:i:m:dhc", arglist, NULL)) != -1 && argval != 255) {
switch (argval) {
case 'h':
printf("Usage: sysuh3c [arg]\n"
Expand Down

0 comments on commit 330cd74

Please sign in to comment.