kern

changeset 9:af6f4adc43d6

fixed a bug in strrchr and some warnings
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 16 Feb 2011 08:01:19 +0200
parents 78d5c304ddd0
children b11a86695493
files src/klibc/string.c src/mboot.S
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line diff
     1.1 --- a/src/klibc/string.c	Wed Feb 16 07:50:25 2011 +0200
     1.2 +++ b/src/klibc/string.c	Wed Feb 16 08:01:19 2011 +0200
     1.3 @@ -66,7 +66,7 @@
     1.4  {
     1.5  	while(*s) {
     1.6  		if(*s == c) {
     1.7 -			return s;
     1.8 +			return (char*)s;
     1.9  		}
    1.10  		s++;
    1.11  	}
    1.12 @@ -75,15 +75,15 @@
    1.13  
    1.14  char *strrchr(const char *s, int c)
    1.15  {
    1.16 -	char *ptr = s;
    1.17 +	const char *ptr = s;
    1.18  
    1.19  	/* find the end */
    1.20  	while(*ptr) ptr++;
    1.21  
    1.22  	/* go back checking for c */
    1.23 -	while(*--ptr >= s) {
    1.24 +	while(--ptr >= s) {
    1.25  		if(*ptr == c) {
    1.26 -			return ptr;
    1.27 +			return (char*)ptr;
    1.28  		}
    1.29  	}
    1.30  	return 0;
     2.1 --- a/src/mboot.S	Wed Feb 16 07:50:25 2011 +0200
     2.2 +++ b/src/mboot.S	Wed Feb 16 08:01:19 2011 +0200
     2.3 @@ -9,7 +9,7 @@
     2.4  	.long MAGIC
     2.5  	.long FLAGS
     2.6  	.long -(MAGIC + FLAGS)	/* checksum */
     2.7 -	.fill 5, 4	/* fill out the rest with zeroes */
     2.8 +	.fill 5, 4, 0	/* fill out the rest with zeroes */
     2.9  
    2.10  	.globl kentry
    2.11  kentry: