diff options
Diffstat (limited to 'sed')
-rw-r--r-- | sed/execute.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sed/execute.c b/sed/execute.c index cb84192..2e13ee2 100644 --- a/sed/execute.c +++ b/sed/execute.c @@ -1567,7 +1567,8 @@ execute_program(vec, input) if (strncmp(line.active + idx, trans[2*i], mbclen) == 0) { bool move_remain_buffer = false; - int trans_len = strlen(trans[2*i+1]); + const char *tr = trans[2*i+1]; + size_t trans_len = *tr == '\0' ? 1 : strlen (tr); if (mbclen < trans_len) { |