| 94 | } |
| 95 | |
| 96 | int ReadTextFromConsole(NULLCArray data) |
| 97 | { |
| 98 | char buffer[2048]; |
| 99 | |
| 100 | InitConsole(); |
| 101 | if(fgets(buffer, 2048, stdin)) |
| 102 | { |
| 103 | char *pos = strchr(buffer, '\n'); |
| 104 | if(pos) |
| 105 | *pos = '\0'; |
| 106 | } |
| 107 | unsigned int len = (unsigned int)strlen(buffer) + 1; |
| 108 | char *target = data.ptr; |
| 109 | for(unsigned int i = 0; i < (data.len < len ? data.len : len); i++) |
| 110 | target[i] = buffer[i]; |
| 111 | buffer[data.len-1] = 0; |
| 112 | |
| 113 | return ((unsigned int)len < data.len ? len : data.len); |
| 114 | } |
| 115 | |
| 116 | void WriteToConsoleExact(NULLCArray data) |
| 117 | { |
nothing calls this directly
no test coverage detected