OSDN Git Service

Backport change from 3.0.0: GCU: use waddnstr() in the text hook rather than using...
authorEric Branlund <ebranlund@fastmail.com>
Tue, 21 Jun 2022 16:09:49 +0000 (10:09 -0600)
committerEric Branlund <ebranlund@fastmail.com>
Tue, 21 Jun 2022 17:10:20 +0000 (11:10 -0600)
src/main-gcu.c

index 06a20b4..5d534b9 100644 (file)
@@ -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);