| 775 | } |
| 776 | |
| 777 | static std::string readStdin() |
| 778 | { |
| 779 | char buf[4096]; |
| 780 | std::string ret; |
| 781 | |
| 782 | while (!feof(stdin)) { |
| 783 | size_t bread = fread(buf, 1, sizeof(buf), stdin); |
| 784 | ret.append(buf, bread); |
| 785 | if (bread < sizeof(buf)) |
| 786 | break; |
| 787 | } |
| 788 | |
| 789 | if (ferror(stdin)) |
| 790 | throw std::runtime_error("error reading stdin"); |
| 791 | |
| 792 | return TrimString(ret); |
| 793 | } |
| 794 | |
| 795 | static int CommandLineRawTx(int argc, char* argv[]) |
| 796 | { |
no test coverage detected