diff --git a/arguments_parsing.c b/arguments_parsing.c index ee033a9..67685eb 100644 --- a/arguments_parsing.c +++ b/arguments_parsing.c @@ -86,7 +86,7 @@ char *parse_command_line_arguments(int argc, char *argv[]) { long timeout_arg_value = strtol(optarg, NULL, 10); if (timeout_arg_value < TIMEOUT_MIN_SUPPORTED_VALUE || timeout_arg_value > TIMEOUT_MAX_SUPPORTED_VALUE || errno != 0) { - fprintf_error("Invalid timeout value: \"%s\". Range supported: %ld-%ld", optarg, + fprintf_error("Invalid timeout value: \"%s\". Range supported: %ld-%ld\n", optarg, TIMEOUT_MIN_SUPPORTED_VALUE, TIMEOUT_MAX_SUPPORTED_VALUE); print_usage(argv[0]); exit(1); @@ -133,12 +133,12 @@ char *parse_command_line_arguments(int argc, char *argv[]) { exit(1); } if (quiet && debug) { - fprintf_error("Incompatible options --quiet|-q and --debug used"); + fprintf_error("Incompatible options --quiet|-q and --debug used\n"); print_usage(argv[0]); exit(1); } if (quiet && verbose) { - fprintf_error("Incompatible options --quiet|-q and --verbose|-v used"); + fprintf_error("Incompatible options --quiet|-q and --verbose|-v used\n"); print_usage(argv[0]); exit(1); } diff --git a/main.c b/main.c index 8b5625b..42a9a4f 100644 --- a/main.c +++ b/main.c @@ -138,7 +138,7 @@ int main(int argc, char *argv[]) { x_display = XOpenDisplay(NULL); if (!x_display) { xscreensaver_is_available = 0; - fprintf_error("Couldn't open an X11 display!"); + fprintf_error("Couldn't open an X11 display!\n"); } else { int xscreensaver_event_base, xscreensaver_error_base; //not sure why these are needed xscreensaver_is_available = XScreenSaverQueryExtension(x_display, &xscreensaver_event_base, @@ -149,7 +149,7 @@ int main(int argc, char *argv[]) { } if (!xscreensaver_is_available) { - fprintf_error("No available method for detecting user idle time on the system, user will be considered idle to allow the command to finish."); + fprintf_error("No available method for detecting user idle time on the system, user will be considered idle to allow the command to finish.\n"); } pid = run_shell_command(shell_command_to_run); diff --git a/tty_utils.c b/tty_utils.c index 4cc671f..0615582 100644 --- a/tty_utils.c +++ b/tty_utils.c @@ -12,9 +12,7 @@ void print_colored_prefix(FILE *stream, const char *color, bool is_tty) { void print_colored_suffix(FILE *stream, bool is_tty) { if (is_tty) { - fprintf(stream, "\033[0m\n"); - } else { - fprintf(stream, "\n"); + fprintf(stream, "\033[0m"); } }