diff options
Diffstat (limited to '')
-rw-r--r-- | util/strgutil.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/util/strgutil.c b/util/strgutil.c index 271949fb5..f176d35dd 100644 --- a/util/strgutil.c +++ b/util/strgutil.c @@ -77,15 +77,15 @@ strlist_last( STRLIST node ) * substring in BUF or NULL if not found. * Comparison is case-in-sensitive. */ -char * -memistr( char *buf, size_t buflen, const char *sub ) +const char * +memistr( const char *buf, size_t buflen, const char *sub ) { const byte *t, *s ; size_t n; for( t=buf, n=buflen, s=sub ; n ; t++, n-- ) if( toupper(*t) == toupper(*s) ) { - for( buf=(char*)t++, buflen = n--, s++; + for( buf=t++, buflen = n--, s++; n && toupper(*t) == toupper(*s); t++, s++, n-- ) ; if( !*s ) |