From 807e19385480696ce9fbd8dbdee946df224eaddf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 10 Oct 2022 17:17:38 +0200 Subject: [PATCH] xtgettcap: exit immediately when there are no capabilities to query for --- utils/xtgettcap.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utils/xtgettcap.c b/utils/xtgettcap.c index e21de7c0..b3ab712a 100644 --- a/utils/xtgettcap.c +++ b/utils/xtgettcap.c @@ -67,10 +67,13 @@ unhexlify(char *dst, const char *src) int main(int argc, const char *const *argv) { - enable_raw_mode(); - const size_t query_count = argc - 1; + if (query_count == 0) + return 0; + + enable_raw_mode(); + printf("\x1bP+q"); for (int i = 1; i < argc; i++) printf("%s%s", i > 1 ? ";" : "", hexlify(argv[i]));