public: crtlib: make Q_strchrnul return non-const pointer, like strchr

This commit is contained in:
Alibek Omarov
2024-11-17 13:56:31 +03:00
parent 622d88eeba
commit 3691f02359
+3 -3
View File
@@ -276,11 +276,11 @@ char *Q_stristr( const char *s1, const char *s2 );
#if HAVE_STRCHRNUL
#define Q_strchrnul strchrnul
#else // !HAVE_STRCHRNUL
static inline const char *Q_strchrnul( const char *s, int c )
static inline char *Q_strchrnul( const char *s, int c )
{
const char *p = Q_strchr( s, c );
char *p = (char *)Q_strchr( s, c );
if( p ) return p;
return s + Q_strlen( s );
return (char *)s + Q_strlen( s );
}
#endif // !HAVE_STRCHRNUL