| 55 | } |
| 56 | |
| 57 | bool read_string(const PhysicalLayer& phys, PAddr pa, std::size_t max, std::string& out) { |
| 58 | std::vector<u8> b(max); |
| 59 | std::size_t got = phys.read(pa, b.data(), b.size()); |
| 60 | if (got == 0) return false; |
| 61 | std::size_t n = 0; |
| 62 | while (n < got && b[n]) ++n; |
| 63 | out.assign(reinterpret_cast<char*>(b.data()), n); |
| 64 | return true; |
| 65 | } |
| 66 | |
| 67 | } // anonymous |
| 68 |
no test coverage detected