-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edit code, please! #1
Comments
Without the while loop, only one option can get parsed. char c;
while((c = getopt(argc, argv, "d:f:h")) != -1) {
+ printf("debug: c=%0x\n", c);
switch (c) {
case 'd':
device = optarg; then compile and run the program and see what it prints out. |
@zhenyolka is right about the bug (GNU/Linux system: mobian pinephone = debian/bookworm + mobian/bookworm, gcc) , but you @julianwi are also right about how to debug. :) I got an infinite loop printing
Changing from
to
solved this. :) An 8-bit unsigned int is not the same as a signed integer... Feel free to consider this commit to be a merge request - cross-git-repository-hosts merge requests don't yet work directly (forgefed - https://forgefed.peers.community - is still in its infancy, and Microsoft is unlikely to cooperate with the community anyway): https://codeberg.org/boud/fbkeyboard/commit/6533c5fd871fe8adfae477c3141366d3a63865d9 |
bugfix, gfx improvement
Sorry for my English.
Thank you! You make perfect keyboard, but i cant start it on my phone. I compile with makefile.
If i try run programm, it do nothing. it stop on forever loop.
please remove this
while((c = getopt(argc, argv, "d:f:h")) != -1) {
switch (c) {
case 'd':
device = optarg;
break;
case 'f':
font = optarg;
break;
case 'h':
printf("usage: %s [options]\npossible options are:\n -h: print this help\n -d: set path to inputdevice\n -f: set path to font\n", argv[0]);
exit(0);
break;
case '?':
fprintf(stderr, "unrecognized option -%c\n", optopt);
break;
}
}
and replace to it
c = getopt(argc, argv, "d:f:h")
switch (c) {
case 'd':
device = optarg;
break;
case 'f':
font = optarg;
break;
case 'h':
printf("usage: %s [options]\npossible options are:\n -h: print this help\n -d: set path to inputdevice\n -f: set path to font\n", argv[0]);
exit(0);
break;
case '?':
fprintf(stderr, "unrecognized option -%c\n", optopt);
break;
}
it works good and not do forever loop.
The text was updated successfully, but these errors were encountered: