Skip to content

Commit 9fb248b

Browse files
committed
Fix indifinite loop on Termux
On Termux pdfsearch loops forever on getop_long() because char is probably unsigned on Termux, whatever it uses as a standard library. Changing the result to int fixes it and shouldn't be a problem on any platform
1 parent e87d78d commit 9fb248b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/options.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Pdfsearch::Options::parseConfigOption() {
6262
{ 0, 0, 0, 0 }
6363
};
6464

65-
char c;
65+
int c;
6666
while ((c = getopt_long(argc, argv, shortopts, longopts, 0)) != -1) {
6767
if (c == 'c') {
6868
config = optarg;
@@ -94,7 +94,7 @@ Pdfsearch::Options::getopt() {
9494
{ 0, 0, 0, 0 }
9595
};
9696

97-
char c;
97+
int c;
9898
while ((c = getopt_long(argc, argv, shortopts, longopts, 0)) != -1) {
9999
std::ostringstream error;
100100
switch (c) {

0 commit comments

Comments
 (0)