Perform some code cleanup

This commit is contained in:
Justine Tunney 2023-05-28 19:42:00 -07:00
parent 992a4638ae
commit 72f8bd10b7
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
8 changed files with 55 additions and 265 deletions

View file

@ -166,10 +166,16 @@ static char *__ubsan_itpcpy(char *p, struct UbsanTypeDescriptor *t,
}
}
static size_t __ubsan_strlen(const char *s) {
size_t i = 0;
while (s[i]) ++i;
return i;
}
static const char *__ubsan_dubnul(const char *s, unsigned i) {
size_t n;
while (i--) {
if ((n = __strlen(s))) {
if ((n = __ubsan_strlen(s))) {
s += n + 1;
} else {
return NULL;