comparison nnchat.c @ 55:5ec3b7d14715

Add typecasts to fix printing of 8-bit characters.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 11 Nov 2008 10:53:15 +0200
parents f6666e7c1a48
children 7b9049defee3
comparison
equal deleted inserted replaced
54:f6666e7c1a48 55:5ec3b7d14715
431 while (*s) { 431 while (*s) {
432 if (*s == '½') { 432 if (*s == '½') {
433 int val = 0; 433 int val = 0;
434 s++; 434 s++;
435 if (*s == '½') { 435 if (*s == '½') {
436 waddch(win, *s | col); 436 waddch(win, ((unsigned char) *s) | col);
437 s++; 437 s++;
438 } else { 438 } else {
439 while (*s && isdigit(*s)) { 439 while (*s && isdigit(*s)) {
440 val *= 10; 440 val *= 10;
441 val += (*s - '0'); 441 val += (*s - '0');
449 } else if (val < 30) { 449 } else if (val < 30) {
450 col = A_BOLD | COLOR_PAIR(val - 9); 450 col = A_BOLD | COLOR_PAIR(val - 9);
451 } 451 }
452 } 452 }
453 } else { 453 } else {
454 waddch(win, *s | col); 454 waddch(win, ((unsigned char) *s) | col);
455 s++; 455 s++;
456 } 456 }
457 } 457 }
458 return 0; 458 return 0;
459 } 459 }