From: Eric Branlund Date: Tue, 21 Jun 2022 16:09:49 +0000 (-0600) Subject: Backport change from 3.0.0: GCU: use waddnstr() in the text hook rather than using... X-Git-Tag: vmacos1.6.2-d~4 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=860ef1d20d2098294a022f855b38e2576391e43f;hp=aa0b4985bbd1f7606edcaac833319dd6a209b83d;p=hengbandforosx%2Fhengbandosx.git Backport change from 3.0.0: GCU: use waddnstr() in the text hook rather than using a fixed size temporary buffer to insert a terminating null character --- diff --git a/src/main-gcu.c b/src/main-gcu.c index 06a20b410..5d534b987 100644 --- a/src/main-gcu.c +++ b/src/main-gcu.c @@ -1092,10 +1092,6 @@ static errr Term_text_gcu(int x, int y, int n, byte a, cptr s) { term_data *td = (term_data *)(Term->data); - int i; - - char text[81]; - #ifdef USE_NCURSES_ACS /* do we have colors + 16 ? */ /* then call special routine for drawing special characters */ @@ -1106,9 +1102,6 @@ static errr Term_text_gcu(int x, int y, int n, byte a, cptr s) } #endif - /* Obtain a copy of the text */ - for (i = 0; i < n; i++) text[i] = s[i]; text[n] = 0; - /* Move the cursor and dump the string */ wmove(td->win, y, x); @@ -1118,7 +1111,7 @@ static errr Term_text_gcu(int x, int y, int n, byte a, cptr s) #endif /* Add the text */ - waddstr(td->win, text); + waddnstr(td->win, s, n); /* Success */ return (0);