wayclip

Wayland clipboard utility
git clone git://git.nihaljere.xyz/wayclip
Log | Files | Refs | README | LICENSE

commit f4058338ccc4ef237a1e5a8ae3328736d9817605
parent 362209f0ce82f000091b3fb0cd8406ff78866bc9
Author: Nihal Jere <nihal@nihaljere.xyz>
Date:   Sat,  2 Jul 2022 21:42:38 -0500

brace style

Diffstat:
Mutil.c | 11+++++------
Mwaycopy.c | 3+--
2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/util.c b/util.c @@ -72,15 +72,14 @@ parseopts(const char *opts, int argc, char *const argv[]) while (1) { int next = getopt(argc, argv, opts); if (next == -1) { - if (argv[optind] && *argv[optind] != '-') { + if (argv[optind] && *argv[optind] != '-') usage(1); - } + break; } - if (next == ':' || next == '?') { + if (next == ':' || next == '?') exit(1); - } switch (next) { case 'f': @@ -92,9 +91,9 @@ parseopts(const char *opts, int argc, char *const argv[]) options.seat = optarg; break; case 't': - if (strlen(optarg) > 255) { + if (strlen(optarg) > 255) die("mimetype can be at most 255 characters"); - } + options.type = optarg; break; } diff --git a/waycopy.c b/waycopy.c @@ -102,9 +102,8 @@ main(int argc, char *argv[]) if (!options.foreground) { pid_t pid = fork(); - if (pid == -1) { + if (pid == -1) die("failed to fork"); - } if (pid != 0) { close(STDERR_FILENO);