| 2465 | // display and a string buffer to fill with it. |
| 2466 | |
| 2467 | void InputString(CONST char *szPrompt, char *sz) |
| 2468 | { |
| 2469 | FILE *file; |
| 2470 | int cch; |
| 2471 | |
| 2472 | file = is.S; is.S = stdout; |
| 2473 | PrintSz(szPrompt); |
| 2474 | AnsiColor(kYellowA); |
| 2475 | PrintSz(" > "); |
| 2476 | AnsiColor(kDefault); |
| 2477 | if (fgets(sz, cchSzMax, stdin) == NULL) // Pressing Control+d terminates |
| 2478 | Terminate(tcForce); // the program on some systems. |
| 2479 | cch = CchSz(sz); |
| 2480 | while (cch > 0 && sz[cch-1] < ' ') |
| 2481 | cch--; |
| 2482 | sz[cch] = chNull; |
| 2483 | is.S = file; |
| 2484 | is.cchCol = 0; |
| 2485 | } |
| 2486 | |
| 2487 | |
| 2488 | // Prompt the user for a floating point value, parsing as appropriate, and |
no test coverage detected