Skip to content

Commit

Permalink
utils: add asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
joelguittet committed Nov 3, 2023
1 parent 9125db0 commit f5a523a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/src/mender-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,14 @@ mender_utils_http_status_to_string(int status) {
char *
mender_utils_strrstr(const char *haystack, const char *needle) {

assert(NULL != haystack);
assert(NULL != needle);

char *r = NULL;

if (!needle[0])
if (!needle[0]) {
return (char *)haystack + strlen(haystack);
}

while (1) {
char *p = strstr(haystack, needle);
Expand Down

0 comments on commit f5a523a

Please sign in to comment.