diff options
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -138,12 +138,15 @@ int shell_replace(TxtLoc start, TxtLoc end, const char *cmd) { TxtLoc l = start; while (txt_before(l, end)) { char c = txt_byte(l); - ASSERT(write(in, &c, 1) == 1); + if (write(in, &c, 1) != 1) { + close(in); + close(out); + return -1; + } l = bnext(l); } close(in); - char c = 0; txt_delete_range(start, end); DYNARR(char) buf = { 0 }; DA_AFIT(&buf, &scratch, 1024); @@ -420,7 +423,6 @@ int main(int argc, const char **argv) { /* fallthrough */ case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': -add_to_count: count = (count % 100000000) * 10 + c - '0'; break; case 'M': { |
