Skip to content

Commit e21c881

Browse files
committed
qrexec-client: Use bool instead of int for booleans
This makes the code slightly clearer. No functional change intended.
1 parent a2c5829 commit e21c881

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

daemon/qrexec-client.c

+9-9
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
#include "libqrexec-utils.h"
4242

4343
// whether qrexec-client should replace problematic bytes with _ before printing the output
44-
static int replace_chars_stdout = 0;
45-
static int replace_chars_stderr = 0;
44+
static bool replace_chars_stdout = false;
45+
static bool replace_chars_stderr = false;
4646

4747
static int exit_with_code = 1;
4848

@@ -54,7 +54,7 @@ static int local_stdin_fd, local_stdout_fd;
5454
static pid_t local_pid = 0;
5555
/* flag if this is "remote" end of service call. In this case swap STDIN/STDOUT
5656
* msg types and send exit code at the end */
57-
static int is_service = 0;
57+
static bool is_service = false;
5858

5959
static volatile sig_atomic_t sigchld = 0;
6060

@@ -543,7 +543,7 @@ int main(int argc, char **argv)
543543
int data_domain;
544544
int msg_type;
545545
int s;
546-
int just_exec = 0;
546+
bool just_exec = false;
547547
int wait_connection_end = 0;
548548
char *local_cmdline = NULL;
549549
char *remote_cmdline = NULL;
@@ -572,7 +572,7 @@ int main(int argc, char **argv)
572572
local_cmdline = xstrdup(optarg);
573573
break;
574574
case 'e':
575-
just_exec = 1;
575+
just_exec = true;
576576
break;
577577
case 'E':
578578
exit_with_code = 0;
@@ -583,13 +583,13 @@ int main(int argc, char **argv)
583583
usage(argv[0]);
584584
}
585585
parse_connect(optarg, &request_id, &src_domain_name, &src_domain_id);
586-
is_service = 1;
586+
is_service = true;
587587
break;
588588
case 't':
589-
replace_chars_stdout = 1;
589+
replace_chars_stdout = true;
590590
break;
591591
case 'T':
592-
replace_chars_stderr = 1;
592+
replace_chars_stderr = true;
593593
break;
594594
case 'w':
595595
connection_timeout = parse_int(optarg, "connection timeout");
@@ -616,7 +616,7 @@ int main(int argc, char **argv)
616616

617617
register_exec_func(&do_exec);
618618

619-
if (just_exec + (request_id != NULL) + (local_cmdline != 0) > 1) {
619+
if (just_exec + (request_id != NULL) + (local_cmdline != NULL) > 1) {
620620
fprintf(stderr, "ERROR: only one of -e, -l, -c can be specified\n");
621621
usage(argv[0]);
622622
}

0 commit comments

Comments
 (0)