From: cohrs Date: Thu, 23 Oct 2003 01:30:05 +0000 (+0000) Subject: extra control characters in panic messages X-Git-Tag: MOVE2GIT~1656 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cc52b2f533e3e879da860a900d3ef96946aeab7f;p=nethack extra control characters in panic messages 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. --- diff --git a/src/questpgr.c b/src/questpgr.c index ff0c9a7a4..b4b80af69 100644 --- a/src/questpgr.c +++ b/src/questpgr.c @@ -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 diff --git a/win/X11/winX.c b/win/X11/winX.c index 743e42916..e04d04d4c 100644 --- a/win/X11/winX.c +++ b/win/X11/winX.c @@ -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); diff --git a/win/X11/winmap.c b/win/X11/winmap.c index 024ba51fc..a72ea51ec 100644 --- a/win/X11/winmap.c +++ b/win/X11/winmap.c @@ -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); diff --git a/win/X11/winmisc.c b/win/X11/winmisc.c index 29140e447..c08322ec4 100644 --- a/win/X11/winmisc.c +++ b/win/X11/winmisc.c @@ -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; }