- TextLength = 0;
- for (column = 0; column < DATA_COLS; column++) {
- if (((int) cpu8051_ReadD(Address + column) >= 32) &&
- ((int) cpu8051_ReadD(Address + column) <= 126))
- TextLength += sprintf(
- &TextTmp[TextLength],
- "%c", cpu8051_ReadD(Address + column));
- else
- TextLength +=
- sprintf(&TextTmp[TextLength], ".");
+ /* Append to ASCII string (if applicable). */
+ if (!isprint(data))
+ data = '.';
+ sprintf(&ascii_str[col], "%c", data);