]> granicus.if.org Git - nethack/commitdiff
extra control characters in panic messages
authorcohrs <cohrs>
Thu, 23 Oct 2003 01:30:05 +0000 (01:30 +0000)
committercohrs <cohrs>
Thu, 23 Oct 2003 01:30:05 +0000 (01:30 +0000)
I noticed a few panic messages contained newlines, and one included a naked
carriage return.  panic() adds a newline itself, and also generally ensures
the message will be on a new line (the initial "oops" ensures the message
itself will be on a new lines).  This patch removes the unneeded characters.

src/questpgr.c
win/X11/winX.c
win/X11/winmap.c
win/X11/winmisc.c

index ff0c9a7a40b1aec89f2ba015f5d9e2e2633ddcb8..b4b80af696cfed558d204c58b726a7471dc302aa 100644 (file)
@@ -60,7 +60,7 @@ dlb   *stream;
 
        if ((cnt = dlb_fread(ptr, size, nitems, stream)) != nitems) {
 
-           panic("PREMATURE EOF ON QUEST TEXT FILE!\nExpected %d bytes - got %d\n",
+           panic("PREMATURE EOF ON QUEST TEXT FILE! Expected %d bytes, got %d",
                    (size * nitems), (size * cnt));
        }
 }
@@ -96,7 +96,7 @@ load_qtlist()
 
        msg_file = dlb_fopen(QTEXT_FILE, RDBMODE);
        if (!msg_file)
-           panic("\rCANNOT OPEN QUEST TEXT FILE %s.", QTEXT_FILE);
+           panic("CANNOT OPEN QUEST TEXT FILE %s.", QTEXT_FILE);
 
        /*
         * Read in the number of classes, then the ID's & offsets for
index 743e42916d67772d285389ef0b3bae1c0d17cb18..e04d04d4cb649dc1141d59944ac8f7a4f420db97 100644 (file)
@@ -688,7 +688,7 @@ X11_create_nhwindow(type)
            create_text_window(wp);
            break;
        default:
-           panic("create_nhwindow: unknown type [%d]\n", type);
+           panic("create_nhwindow: unknown type [%d]", type);
            break;
     }
     return window;
@@ -712,7 +712,7 @@ X11_clear_nhwindow(window)
            /* do nothing for these window types */
            break;
        default:
-           panic("clear_nhwindow: unknown window type [%d]\n", wp->type);
+           panic("clear_nhwindow: unknown window type [%d]", wp->type);
            break;
     }
 }
@@ -775,7 +775,7 @@ X11_display_nhwindow(window, blocking)
            display_text_window(wp, blocking);  /* pop up text window */
            break;
        default:
-           panic("display_nhwindow: unknown window type [%d]\n", wp->type);
+           panic("display_nhwindow: unknown window type [%d]", wp->type);
            break;
     }
 }
@@ -899,7 +899,7 @@ void X11_outrip(window, how)
     if (wp->type == NHW_TEXT) {
        wp->text_information->is_rip = TRUE;
     } else {
-       panic("ripout on non-text window (window type [%d])\n", wp->type);
+       panic("ripout on non-text window (window type [%d])", wp->type);
     }
 
     calculate_rip_text(how);
index 024ba51fcb7e3d9d3bc89ede40ba4ccac87d43ed..a72ea51ec58d2d604f01464f096481b2dd875137 100644 (file)
@@ -1654,7 +1654,7 @@ x_event(exit_condition)
                }
                break;
            default:
-               panic("x_event: unknown exit condition %d\n", exit_condition);
+               panic("x_event: unknown exit condition %d", exit_condition);
                break;
        }
     } while (keep_going);
index 29140e4470fea24d65c4b9f9b4fccbd151d77ed0..c08322ec49e4b0193da191b1acda8d65b61f3f2c 100644 (file)
@@ -327,7 +327,7 @@ X11_player_selection()
        } else if (ps_selected == PS_RANDOM) {
            flags.initrole = ROLE_RANDOM;
        } else if (ps_selected < 0 || ps_selected >= num_roles) {
-           panic("player_selection: bad role select value %d\n", ps_selected);
+           panic("player_selection: bad role select value %d", ps_selected);
        } else {
            flags.initrole = ps_selected;
        }
@@ -392,7 +392,7 @@ X11_player_selection()
            } else if (ps_selected == PS_RANDOM) {
                flags.initrace = ROLE_RANDOM;
            } else if (ps_selected < 0 || ps_selected >= num_races) {
-               panic("player_selection: bad race select value %d\n", ps_selected);
+               panic("player_selection: bad race select value %d", ps_selected);
            } else {
                flags.initrace = ps_selected;
            }
@@ -457,7 +457,7 @@ X11_player_selection()
            } else if (ps_selected == PS_RANDOM) {
                flags.initgend = ROLE_RANDOM;
            } else if (ps_selected < 0 || ps_selected >= num_gends) {
-               panic("player_selection: bad gender select value %d\n", ps_selected);
+               panic("player_selection: bad gender select value %d", ps_selected);
            } else {
                flags.initgend = ps_selected;
            }
@@ -521,7 +521,7 @@ X11_player_selection()
            } else if (ps_selected == PS_RANDOM) {
                flags.initalign = ROLE_RANDOM;
            } else if (ps_selected < 0 || ps_selected >= num_algns) {
-               panic("player_selection: bad alignment select value %d\n", ps_selected);
+               panic("player_selection: bad alignment select value %d", ps_selected);
            } else {
                flags.initalign = ps_selected;
            }