From 6b91e7762c65097a103b2b17db304a4d85b3573d Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 19 Mar 1998 15:27:29 +0000 Subject: some cleanups --- util/strgutil.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'util/strgutil.c') 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 ) -- cgit v1.2.3