Skip to content

Commit 55e923a

Browse files
committed
Fix return type of poptGetNextOpt (closes #11)
1 parent cb52651 commit 55e923a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ttblue.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@ int main(int argc, const char **argv)
322322
TTDEV *ttd;
323323

324324
// parse args
325-
char ch;
325+
int ch;
326+
char dangling;
326327
poptContext optCon = poptGetContext(NULL, argc, argv, options, 0);
327328

328329
while ((ch=poptGetNextOpt(optCon))>=0) {
@@ -504,7 +505,7 @@ int main(int argc, const char **argv)
504505
// prompt for pairing code
505506
if (new_pair) {
506507
fputs(PAIRING_CODE_PROMPT, stderr);
507-
if (!(scanf("%d%c", &dev_code, &ch) && isspace(ch))) {
508+
if (!(scanf("%d%c", &dev_code, &dangling) && isspace(dangling))) {
508509
fprintf(stderr, "Pairing code should be 6-digit number.\n");
509510
goto fatal;
510511
}

0 commit comments

Comments
 (0)