]> git.sur5r.net Git - i3/i3/commitdiff
Remove \n from errx and die messages 3574/head
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Wed, 2 Jan 2019 12:05:18 +0000 (19:05 +0700)
committerOrestis Floros <orestisf1993@gmail.com>
Wed, 2 Jan 2019 12:23:56 +0000 (14:23 +0200)
errx() already appends \n internally. "\n" in the error message will
result in a blank line after the message. die() is just a wrapper around
errx() so it receives the same treatment.

i3-config-wizard/main.c
i3-input/main.c
i3-nagbar/main.c
src/main.c
src/restore_layout.c
testcases/inject_randr1.5.c

index 4b55665773e39821ed175efdb58df00664d87659..7c1f00a397183afd359251bf348874d4bccfe984 100644 (file)
@@ -822,7 +822,7 @@ int main(int argc, char *argv[]) {
     int screen;
     if ((conn = xcb_connect(NULL, &screen)) == NULL ||
         xcb_connection_has_error(conn))
-        errx(1, "Cannot open display\n");
+        errx(1, "Cannot open display");
 
     if (xkb_x11_setup_xkb_extension(conn,
                                     XKB_X11_MIN_MAJOR_XKB_VERSION,
@@ -859,7 +859,7 @@ int main(int argc, char *argv[]) {
     root = root_screen->root;
 
     if (!(modmap_reply = xcb_get_modifier_mapping_reply(conn, modmap_cookie, NULL)))
-        errx(EXIT_FAILURE, "Could not get modifier mapping\n");
+        errx(EXIT_FAILURE, "Could not get modifier mapping");
 
     xcb_numlock_mask = get_mod_mask_for(XCB_NUM_LOCK, symbols, modmap_reply);
 
@@ -899,7 +899,7 @@ int main(int argc, char *argv[]) {
     do {                                                                                   \
         xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(conn, name##_cookie, NULL); \
         if (!reply)                                                                        \
-            errx(EXIT_FAILURE, "Could not get atom " #name "\n");                          \
+            errx(EXIT_FAILURE, "Could not get atom " #name);                               \
                                                                                            \
         A_##name = reply->atom;                                                            \
         free(reply);                                                                       \
index d1a2efd7cab6b485b4652542e2f4d9459fa237b1..f15a74abeea1534fde6e5a364dd591020bb251e8 100644 (file)
@@ -435,7 +435,7 @@ int main(int argc, char *argv[]) {
     int screen;
     conn = xcb_connect(NULL, &screen);
     if (!conn || xcb_connection_has_error(conn))
-        die("Cannot open display\n");
+        die("Cannot open display");
 
     sockfd = ipc_connect(socket_path);
 
index 4ce7493961caf7ed5e35674cbc441843aed0d1eb..ec3e25fb62945a8f3186484c38a2237d5edaf9ad 100644 (file)
@@ -418,7 +418,7 @@ int main(int argc, char *argv[]) {
     int screens;
     if ((conn = xcb_connect(NULL, &screens)) == NULL ||
         xcb_connection_has_error(conn))
-        die("Cannot open display\n");
+        die("Cannot open display");
 
 /* Place requests for the atoms we need as soon as possible */
 #define xmacro(atom) \
@@ -512,7 +512,7 @@ int main(int argc, char *argv[]) {
     do {                                                                                   \
         xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(conn, name##_cookie, NULL); \
         if (!reply)                                                                        \
-            die("Could not get atom " #name "\n");                                         \
+            die("Could not get atom " #name);                                              \
                                                                                            \
         A_##name = reply->atom;                                                            \
         free(reply);                                                                       \
index 4a20e0c0623552f935b00ed820ba76fe3e2c6360..074afe718a2152bcc937c27a9ef95b022bb1dbd4 100644 (file)
@@ -515,7 +515,7 @@ int main(int argc, char *argv[]) {
 
     conn = xcb_connect(NULL, &conn_screen);
     if (xcb_connection_has_error(conn))
-        errx(EXIT_FAILURE, "Cannot open display\n");
+        errx(EXIT_FAILURE, "Cannot open display");
 
     sndisplay = sn_xcb_display_new(conn, NULL, NULL);
 
index 9f19a690d9013e40ef7bf268015cd7e40810b6e3..186c0907325b82d4304c34162a1cc0fd3d1bfb90 100644 (file)
@@ -115,7 +115,7 @@ void restore_connect(void) {
 #ifdef I3_ASAN_ENABLED
         __lsan_do_leak_check();
 #endif
-        errx(EXIT_FAILURE, "Cannot open display\n");
+        errx(EXIT_FAILURE, "Cannot open display");
     }
 
     xcb_watcher = scalloc(1, sizeof(struct ev_io));
index 520b021315a61013a071a5d5a34197d575d37054..29b6a33d4c8636a02fd994e58202c68759d1964b 100644 (file)
@@ -402,7 +402,7 @@ int main(int argc, char *argv[]) {
     }
 
     if (optind >= argc) {
-        errx(EXIT_FAILURE, "syntax: %s [options] <command>\n", argv[0]);
+        errx(EXIT_FAILURE, "syntax: %s [options] <command>", argv[0]);
     }
 
     int fd = socket(AF_LOCAL, SOCK_STREAM, 0);