| 815 | } |
| 816 | |
| 817 | static std::string readStdin() |
| 818 | { |
| 819 | char buf[4096]; |
| 820 | std::string ret; |
| 821 | |
| 822 | while (!feof(stdin)) { |
| 823 | size_t bread = fread(buf, 1, sizeof(buf), stdin); |
| 824 | ret.append(buf, bread); |
| 825 | if (bread < sizeof(buf)) |
| 826 | break; |
| 827 | } |
| 828 | |
| 829 | if (ferror(stdin)) |
| 830 | throw std::runtime_error("error reading stdin"); |
| 831 | |
| 832 | return TrimString(ret); |
| 833 | } |
| 834 | |
| 835 | static int CommandLineRawTx(int argc, char* argv[]) |
| 836 | { |
no test coverage detected