Skip to content

Commit a374ff2

Browse files
committed
utils: add asserts
1 parent ca7db70 commit a374ff2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/src/mender-utils.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,14 @@ mender_utils_http_status_to_string(int status) {
104104
char *
105105
mender_utils_strrstr(const char *haystack, const char *needle) {
106106

107+
assert(NULL != haystack);
108+
assert(NULL != needle);
109+
107110
char *r = NULL;
108111

109-
if (!needle[0])
112+
if (!needle[0]) {
110113
return (char *)haystack + strlen(haystack);
114+
}
111115

112116
while (1) {
113117
char *p = strstr(haystack, needle);

0 commit comments

Comments
 (0)