From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Thibault Subject: [PATCH] [Mini-OS] Fix strrchr() Date: Tue, 27 Nov 2007 10:54:12 +0000 Message-ID: <20071127105412.GA4994@implementation.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Fix strrchr() when string doesn't contain the character. Signed-off-by: Samuel Thibault diff -r 26e766e0c628 extras/mini-os/lib/string.c --- a/extras/mini-os/lib/string.c Mon Nov 26 22:28:48 2007 +0000 +++ b/extras/mini-os/lib/string.c Tue Nov 27 10:44:34 2007 +0000 @@ -142,7 +142,7 @@ char * strchr(const char * s, int c) char * strrchr(const char * s, int c) { - const char *res; + const char *res = NULL; for(; *s != '\0'; ++s) if (*s == (char) c) res = s;