- register int len;
- register char *mp, *omp;
- static int lastline = 0;
-
- /*
- * All messages should start with uppercase
- */
- mvaddch(lastline + Y_MSG_START, SCORE_X, ' ');
- if (islower(Msgbuf[0]) && Msgbuf[1] != ')')
- Msgbuf[0] = toupper(Msgbuf[0]);
- mp = Msgbuf;
- len = strlen(mp);
- if (len / MSG_X + Lineno >= MSG_Y) {
- while (Lineno < MSG_Y) {
- wmove(Msgwin, Lineno++, 0);
- wclrtoeol(Msgwin);
- }
- Lineno = 0;
- }
- mvaddch(Lineno + Y_MSG_START, SCORE_X, '*');
- lastline = Lineno;
- do {
- mvwaddstr(Msgwin, Lineno, 0, mp);
- if ((len = strlen(mp)) > MSG_X) {
- omp = mp;
- for (mp = &mp[MSG_X-1]; *mp != ' '; mp--)
- continue;
- while (*mp == ' ')
- mp--;
- mp++;
- wmove(Msgwin, Lineno, mp - omp);
- wclrtoeol(Msgwin);
+ static int lastline = 0;
+ int len;
+ char *mp, *omp;
+
+ /* All messages should start with uppercase */
+ mvaddch(lastline + Y_MSG_START, SCORE_X, ' ');
+ if (islower((unsigned char)Msgbuf[0]) && Msgbuf[1] != ')')
+ Msgbuf[0] = toupper((unsigned char)Msgbuf[0]);
+ mp = Msgbuf;
+ len = strlen(mp);
+ if (len / MSG_X + Lineno >= MSG_Y) {
+ while (Lineno < MSG_Y) {
+ wmove(Msgwin, Lineno++, 0);
+ wclrtoeol(Msgwin);
+ }
+ Lineno = 0;