MCPcopy Create free account
hub / github.com/NetHack/NetHack / random_response

Function random_response

src/cmd.c:3580–3598  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3578}
3579
3580void
3581random_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
3600int
3601rnd_extcmd_idx(void)

Callers 1

mswin_getlin_windowFunction · 0.85

Calls 1

randomkeyFunction · 0.85

Tested by

no test coverage detected