skip useless test

This commit is contained in:
prx 2022-08-18 15:27:44 +02:00
parent 75bfaee73e
commit 875f167eb9
1 changed files with 1 additions and 1 deletions

View File

@ -124,7 +124,7 @@ getsubexp(const char *str, regmatch_t m, char *dst)
{
size_t len = 0;
if (m.rm_eo > m.rm_so) { /* skip empty substring */
if ((len = m.rm_eo - m.rm_so) > 0) { /* skip empty substring */
len = m.rm_eo - m.rm_so;
memcpy(dst, str + m.rm_so, len);
dst[len] = '\0';