From 5eb91a4ca78434838e2f47e47ed3cb5d276a9a5b Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Sun, 4 Feb 2018 12:20:41 +0100 Subject: [PATCH] Fix scrcpy() return value The scrcpy() function returns a SDL_bool to indicate its success, but was initialized to 0 (SDL_FALSE) instead of SDL_TRUE. --- app/src/main.c | 4 +--- app/src/scrcpy.c | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main.c b/app/src/main.c index 6e0557a1..7ab41b75 100644 --- a/app/src/main.c +++ b/app/src/main.c @@ -183,8 +183,6 @@ static int parse_args(struct args *args, int argc, char *argv[]) { } int main(int argc, char *argv[]) { - int res; - struct args args = { .serial = NULL, .help = SDL_FALSE, @@ -210,7 +208,7 @@ int main(int argc, char *argv[]) { SDL_LogSetAllPriority(SDL_LOG_PRIORITY_DEBUG); - res = scrcpy(args.serial, args.port, args.max_size, args.bit_rate) ? 0 : 1; + int res = scrcpy(args.serial, args.port, args.max_size, args.bit_rate) ? 0 : 1; avformat_network_deinit(); // ignore failure diff --git a/app/src/scrcpy.c b/app/src/scrcpy.c index c971556f..dc46ef40 100644 --- a/app/src/scrcpy.c +++ b/app/src/scrcpy.c @@ -519,7 +519,7 @@ void event_loop(void) { } SDL_bool scrcpy(const char *serial, Uint16 local_port, Uint16 max_size, Uint32 bit_rate) { - SDL_bool ret = 0; + SDL_bool ret = SDL_TRUE; process_t push_proc = push_server(serial); if (wait_for_success(push_proc, "adb push")) {