diff --git a/libbozo/src/string/strcmp.c b/libbozo/src/string/strcmp.c index 4456800..616ffd1 100644 --- a/libbozo/src/string/strcmp.c +++ b/libbozo/src/string/strcmp.c @@ -4,8 +4,6 @@ int strcmp(const char *s1, const char *s2) { size_t i = 0; - if (!s1 || !s2) - return -1; while (s1[i] == s2[i] && s1[i] != '\0') i++; return s1[i] - s2[i]; diff --git a/src/shell/commands/color_cmd.c b/src/shell/commands/color_cmd.c index 049fd04..b22545a 100644 --- a/src/shell/commands/color_cmd.c +++ b/src/shell/commands/color_cmd.c @@ -13,12 +13,16 @@ void color_cmd(char *arg) "DARK_GREY", "LIGHT_BLUE", "LIGHT_GREEN", "LIGHT_CYAN", "LIGHT_RED", "LIGHT_MAGENTA", "LIGHT_YELLOW", "WHITE", }; + + if (!arg) + goto invalid; for (size_t i = 0; i < ARRAY_SIZE(colors); i++) { if (strcmp(colors[i], arg) == 0) { terminal_change_default_fg_color(i); return; } } +invalid: tmp_color = terminal_get_default_color(); kprintf(KERN_WARNING "Invalid argument\n"); kprintf("Available colors: ");