| 3578 | } |
| 3579 | |
| 3580 | void |
| 3581 | random_response(char *buf, int sz) |
| 3582 | { |
| 3583 | char c; |
| 3584 | int count = 0; |
| 3585 | |
| 3586 | for (;;) { |
| 3587 | c = randomkey(); |
| 3588 | if (c == '\n') |
| 3589 | break; |
| 3590 | if (c == '\033') { |
| 3591 | count = 0; |
| 3592 | break; |
| 3593 | } |
| 3594 | if (count < sz - 1) |
| 3595 | buf[count++] = c; |
| 3596 | } |
| 3597 | buf[count] = '\0'; |
| 3598 | } |
| 3599 | |
| 3600 | int |
| 3601 | rnd_extcmd_idx(void) |
no test coverage detected