From 82a98a81faf57091a4acf73377b7e672b077e681 Mon Sep 17 00:00:00 2001 From: mazunki Date: Tue, 9 Nov 2021 16:37:24 +0100 Subject: [PATCH] cleaned up some oopsies, more effs, and more linebreaks --- man/wofi.5 | 2 +- src/main.c | 2 +- src/wofi.c | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/man/wofi.5 b/man/wofi.5 index 68848f8..9fbd176 100644 --- a/man/wofi.5 +++ b/man/wofi.5 @@ -109,7 +109,7 @@ Specifies something to search for immediately on opening .B monitor=\fISTRING\fR Sets the monitor to open on .TP -.B pre_display_cmd=\fSTR\fR +.B pre_display_cmd=\fICOMMAND\fR Specifies a printf-like string which is used on the entries prior to displaying them. This command is only used to represent the label widget's string, and won't affect the the output of the selected label. .TP .B orientation=\fIORIENTATION\fR diff --git a/src/main.c b/src/main.c index 778a441..290fe6d 100644 --- a/src/main.c +++ b/src/main.c @@ -108,7 +108,7 @@ void wofi_load_css(bool nyan) { fseek(file, 0, SEEK_SET); char* data = malloc(size + 1); if (fread(data, 1, size, file) == 0) { - printf(stderr, "failed to read stylesheet data from file"); + fprintf(stderr, "failed to read stylesheet data from file\n"); exit(EXIT_FAILURE); } fclose(file); diff --git a/src/wofi.c b/src/wofi.c index 5c61e09..c3855d1 100644 --- a/src/wofi.c +++ b/src/wofi.c @@ -407,7 +407,8 @@ static GtkWidget* create_label(char* mode, char* text, char* search_text, char* // first, prepare cmd_labeltext to be each entry's actual comamand to run, aka replacing 'cat %s' to be 'cat filename' if ((asprintf(&cmd_labeltext, pre_display_cmd, nodetext)) == -1) { fprintf(stderr, "error parsing pre_display_cmd to run\n"); - exit(EXIT_FAILURE); } + exit(EXIT_FAILURE); + } // then, run the command fp_labeltext = popen(cmd_labeltext, "r"); if (fp_labeltext == NULL) { @@ -1283,7 +1284,7 @@ static void do_copy(void) { close(fds[0]); if (write(fds[1], action, strlen(action)) != 0) { - fprintf(stderr, "fd pipe failed to write"); + fprintf(stderr, "fd pipe failed to write\n"); } close(fds[1]);