newlib: libc: Improved the readability of strspn with minor optimization

Signed-off-by: Xiao Zeng <zengxiao@eswincomputing.com>
This commit is contained in:
Xiao Zeng 2024-01-02 13:56:15 +08:00 committed by Jeff Johnston
parent 26f7004bf7
commit 99f3898dfc
1 changed files with 2 additions and 1 deletions

View File

@ -41,10 +41,11 @@ strspn (const char *s1,
for (c = s2; *c; c++)
{
if (*s1 == *c)
break;
goto found;
}
if (*c == '\0')
break;
found:
s1++;
}