Skip to content

Commit 023b6db

Browse files
committed
Fix if/else in unsafe strlen path so that the function always returns something
1 parent f952af3 commit 023b6db

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

libc/src/string/string_utils.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,11 @@ template <typename T> LIBC_INLINE size_t string_length(const T *src) {
9090
// string a block at a time.
9191
if constexpr (cpp::is_same_v<T, char>)
9292
return string_length_wide_read<unsigned int>(src);
93-
#else
93+
#endif
9494
size_t length;
9595
for (length = 0; *src; ++src, ++length)
9696
;
9797
return length;
98-
#endif
9998
}
10099

101100
template <typename Word>

0 commit comments

Comments
 (0)