From 52e5c94314fa8e10efded82db85d181ed32f00bd Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sun, 4 Jun 2023 00:48:15 +0300 Subject: visionfive2 boots until debugging is initialized --- common/string.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'common/string.c') diff --git a/common/string.c b/common/string.c index a76c875..359a938 100644 --- a/common/string.c +++ b/common/string.c @@ -105,13 +105,13 @@ __weak char *strchr(const char *str, int chr) const char *s1 = str; ssize_t num = strlen(s1); - while (num-- && *(s1--) != chr) + while (num-- && *(s1++) != chr) ; if (num < 0) return 0; - return (char *)(s1 + 1); + return (char *)(s1 - 1); } #undef strtok @@ -339,10 +339,10 @@ static int __hexval(char c) return c - '0'; if (c >= 'a' && c <= 'f') - return c - 'a'; + return 10 + c - 'a'; if (c >= 'A' && c <= 'F') - return c - 'A'; + return 10 + c - 'A'; return -1; } -- cgit v1.3