]> Kevux Git Server - fll/commitdiff
Cleanup: remove unnecessary tabbing and move newline.
authorKevin Day <thekevinday@gmail.com>
Tue, 10 Nov 2020 02:19:03 +0000 (20:19 -0600)
committerKevin Day <thekevinday@gmail.com>
Tue, 10 Nov 2020 02:19:03 +0000 (20:19 -0600)
Move the newline to its own printf function that is after any color codes.

level_3/fake/c/main.c
level_3/fake/c/private-fake.c

index b0bc9bd6f121ecfff193a0a7e5918f1f63f609ae..7aa01253605dd91491425f5197ccf426184f1b5c 100644 (file)
 int main(const unsigned long argc, const f_string_t *argv) {
   const f_console_arguments_t arguments = { argc, argv };
   fake_data_t data = fake_data_t_initialize;
-
   f_status_t status = F_none;
 
-  {
-    f_signal_set_empty(&data.signal.set);
-    f_signal_set_add(F_signal_abort, &data.signal.set);
-    f_signal_set_add(F_signal_hangup, &data.signal.set);
-    f_signal_set_add(F_signal_interrupt, &data.signal.set);
-    f_signal_set_add(F_signal_quit, &data.signal.set);
-    f_signal_set_add(F_signal_termination, &data.signal.set);
-    f_signal_set_handle(SIG_BLOCK, &data.signal.set);
-
-    status = f_signal_open(&data.signal);
-
-    // if there is an error opening a signal descriptor, then do not handle signals.
-    if (F_status_is_error(status)) {
-      f_signal_set_handle(SIG_UNBLOCK, &data.signal.set);
-      f_signal_close(&data.signal);
-    }
+  f_signal_set_empty(&data.signal.set);
+  f_signal_set_add(F_signal_abort, &data.signal.set);
+  f_signal_set_add(F_signal_hangup, &data.signal.set);
+  f_signal_set_add(F_signal_interrupt, &data.signal.set);
+  f_signal_set_add(F_signal_quit, &data.signal.set);
+  f_signal_set_add(F_signal_termination, &data.signal.set);
+  f_signal_set_handle(SIG_BLOCK, &data.signal.set);
+
+  status = f_signal_open(&data.signal);
+
+  // if there is an error opening a signal descriptor, then do not handle signals.
+  if (F_status_is_error(status)) {
+    f_signal_set_handle(SIG_UNBLOCK, &data.signal.set);
+    f_signal_close(&data.signal);
   }
 
   // @fixme: bad design in POSIX where there is no get umask without setting it.
index fb89392c441311892a827592d0fa06d06ff8263d..8e550ca8376d8baea553f6e7d4bf7959eaa5d423 100644 (file)
@@ -937,7 +937,8 @@ extern "C" {
 
           if (data.error.verbosity != f_console_verbosity_quiet) {
             fprintf(data.error.to.stream, "%c", f_string_eol[0]);
-            fl_color_print(data.error.to.stream, data.context.set.error, "ALERT: An appropriate exit signal has been received, now aborting.%c", f_string_eol[0]);
+            fl_color_print(data.error.to.stream, data.context.set.error, "ALERT: An appropriate exit signal has been received, now aborting.");
+            fprintf(data.error.to.stream, "%c", f_string_eol[0]);
           }
 
           return F_true;