aboutsummaryrefslogtreecommitdiff
path: root/kernel.c
diff options
context:
space:
mode:
authorDavid <dbphillipsnz@gmail.com>2013-11-30 09:14:45 +1300
committerDavid <dbphillipsnz@gmail.com>2014-03-27 20:32:48 +1300
commit5d944dfe9f03c9fb43271199d2ba4b8880747614 (patch)
treeab57a964538f06e86064ad45cb510673b91b8c94 /kernel.c
parentf5bbf7cf9bd1eff316fd5b2d2ed71abbb49a7ecd (diff)
downloadtoast-5d944dfe9f03c9fb43271199d2ba4b8880747614.tar.xz
Bugfixes in strlen() which used to handle zero-length strings incorrectly
Diffstat (limited to 'kernel.c')
-rw-r--r--kernel.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/kernel.c b/kernel.c
index dec3e57..8ca7927 100644
--- a/kernel.c
+++ b/kernel.c
@@ -41,7 +41,8 @@ void kernel_main(multiboot_info_t *mbd, unsigned int magic)
console_print("--------------------------------\nShowing console_print() off...\n%dd in binary is %b\n%oo = %xh = %dd\n%d is the ASCII code for %c\n--------------------------------\n",100,100,1234,1234,1234,112,112);
-
+ console_print("strlen(\"asdf\") == %d\n",strlen("asdf"));
+ console_print("strlen(\"\") == %d\n",strlen(""));
// Show all memory stuff
uint32_t mmaps = mbd->mmap_length;
@@ -51,9 +52,9 @@ void kernel_main(multiboot_info_t *mbd, unsigned int magic)
mmap = (multiboot_memory_map_t*) ( (unsigned int)mmap + mmap->size + sizeof(unsigned int) );
console_print("%s: 0x%x to 0x%x = %d bytes\n",
mmap->type == 1? "AVAILABLE" : "RESERVED ",
- mmap->addr,
- mmap->addr + mmap->len-1,
- mmap->len
+ (uint32_t)mmap->addr,
+ (uint32_t)mmap->addr + (uint32_t)mmap->len-1,
+ (uint32_t)mmap->len
);
}