| 209 |
{ |
{ |
| 210 |
char line[LINE_BUFFER_LEN]; |
char line[LINE_BUFFER_LEN]; |
| 211 |
char buf[LINE_BUFFER_LEN]; |
char buf[LINE_BUFFER_LEN]; |
|
char buf2[LINE_BUFFER_LEN]; |
|
| 212 |
int pos; |
int pos; |
| 213 |
|
|
| 214 |
if (len < 4) |
if (len < 4) |
| 240 |
|
|
| 241 |
snprintf(buf, sizeof(buf), "%*s%3d%%%*s", |
snprintf(buf, sizeof(buf), "%*s%3d%%%*s", |
| 242 |
(len - 4) / 2, "", percent, (len - 4 + 1) / 2, ""); |
(len - 4) / 2, "", percent, (len - 4 + 1) / 2, ""); |
|
memcpy(buf2, buf, (size_t)pos); |
|
|
buf2[pos] = '\0'; |
|
| 243 |
|
|
| 244 |
moveto(4, 1); |
moveto(4, 1); |
| 245 |
prints("%s\r\n", line); |
prints("%s\r\n", line); |
| 246 |
prints("|\033[46m%s\033[44m%s\033[m|\r\n", buf2, buf + pos); |
prints("|\033[46m%.*s\033[44m%s\033[m|\r\n", pos, buf, buf + pos); |
| 247 |
prints("%s\r\n", line); |
prints("%s\r\n", line); |
| 248 |
iflush(); |
iflush(); |
| 249 |
} |
} |