xtgettcap: exit immediately when there are no capabilities to query for

This commit is contained in:
Daniel Eklöf 2022-10-10 17:17:38 +02:00
parent 4fca380585
commit 807e193854
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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]));