Re: [PATCH] block/curl: use strlen instead of strchr

2024-06-30 Thread Vladimir Sementsov-Ogievskiy
On 01.07.24 09:34, Vladimir Sementsov-Ogievskiy wrote: On 29.06.24 09:20, Michael Tokarev wrote: On 6/28/24 08:49, Vladimir Sementsov-Ogievskiy wrote: We already know where colon is, so no reason to search for it. Also, avoid a code, which looks like we forget to check return value of strchr()

Re: [PATCH] block/curl: use strlen instead of strchr

2024-06-30 Thread Vladimir Sementsov-Ogievskiy
On 29.06.24 09:20, Michael Tokarev wrote: On 6/28/24 08:49, Vladimir Sementsov-Ogievskiy wrote: We already know where colon is, so no reason to search for it. Also, avoid a code, which looks like we forget to check return value of strchr() to NULL. Suggested-by: Kevin Wolf Signed-off-by: Vladi

Re: [PATCH] block/curl: use strlen instead of strchr

2024-06-28 Thread Michael Tokarev
On 6/29/24 09:36, Michael Tokarev wrote: .. +    while (p < end && *t) { +    if (*t == ' ') { +    if (g_ascii_isspace(*p)) { +    ++p; +    } else { +    ++t; } +    } else if (*t == g_ascii_tolower(*p)) { +    ++p, ++t; +   

Re: [PATCH] block/curl: use strlen instead of strchr

2024-06-28 Thread Michael Tokarev
On 6/29/24 09:20, Michael Tokarev wrote: On 6/28/24 08:49, Vladimir Sementsov-Ogievskiy wrote: We already know where colon is, so no reason to search for it. Also, avoid a code, which looks like we forget to check return value of strchr() to NULL. Suggested-by: Kevin Wolf Signed-off-by: Vladim

Re: [PATCH] block/curl: use strlen instead of strchr

2024-06-28 Thread Michael Tokarev
On 6/28/24 08:49, Vladimir Sementsov-Ogievskiy wrote: We already know where colon is, so no reason to search for it. Also, avoid a code, which looks like we forget to check return value of strchr() to NULL. Suggested-by: Kevin Wolf Signed-off-by: Vladimir Sementsov-Ogievskiy --- This replaces

[PATCH] block/curl: use strlen instead of strchr

2024-06-27 Thread Vladimir Sementsov-Ogievskiy
We already know where colon is, so no reason to search for it. Also, avoid a code, which looks like we forget to check return value of strchr() to NULL. Suggested-by: Kevin Wolf Signed-off-by: Vladimir Sementsov-Ogievskiy --- This replaces my patch [PATCH] block/curl: explicitly assert that s