From 4cb35eee1c3bc1d4aca6f0e446fe92a3a0369ab9 Mon Sep 17 00:00:00 2001 From: Ali Mashtizadeh Date: Sun, 13 Jul 2014 14:48:41 -0700 Subject: [PATCH] Fix warnings in kern/debug.c --- sys/kern/debug.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/sys/kern/debug.c b/sys/kern/debug.c index 5b76e73..c1c624f 100644 --- a/sys/kern/debug.c +++ b/sys/kern/debug.c @@ -146,11 +146,15 @@ void Debug_Dump(int argc, const char *argv[]) { uint64_t off, len; - if (argc == 3) + + if (argc != 3) { - off = Debug_SymbolToInt(argv[1]); - len = Debug_SymbolToInt(argv[2]); + kprintf("Dump requires 3 arguments\n"); + return; } + + off = Debug_SymbolToInt(argv[1]); + len = Debug_SymbolToInt(argv[2]); kprintf("Dump 0x%llx 0x%llx\n", off, len); Debug_PrintHex((const char *)off, len, 0, len); } @@ -185,13 +189,13 @@ Debug_Prompt() // execute command if (strcmp(argv[0], "help") == 0) { - Debug_Help(argc, argv); + Debug_Help(argc, (const char **)argv); } else if (strcmp(argv[0], "dump") == 0) { - Debug_Dump(argc, argv); + Debug_Dump(argc, (const char **)argv); } else if (strcmp(argv[0], "registers") == 0) { - Debug_Registers(argc, argv); + Debug_Registers(argc, (const char **)argv); } else if (strcmp(argv[0], "echo") == 0) { - Debug_Echo(argc, argv); + Debug_Echo(argc, (const char **)argv); } else if (strcmp(argv[0], "") != 0) { kprintf("Unknown command '%s'\n", argv[0]); }