From dd3c48e6b0547e5c510a96ffc9e3c43264103fa9 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Mon, 20 Jan 2025 08:30:27 -0400 Subject: [PATCH] MT#55283 fix str_str return type Change-Id: I297199255b0d5204b0f978dc7306da8f2b6e6e34 (cherry picked from commit 9262cac8552348ab3e154212595a79c8a3c07d88) (cherry picked from commit adabb7aeacc05a8815d7d4e6e8d76a2c88942f38) (cherry picked from commit c4fbb8d7b7935fabdb3d95ce075dd7dd33ec571d) --- lib/str.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/str.h b/lib/str.h index 8081487a5..9f5368154 100644 --- a/lib/str.h +++ b/lib/str.h @@ -131,7 +131,7 @@ INLINE int str_memcmp(const str *s, const void *m); __attribute__((nonnull(1, 2))) ACCESS(read_only, 1) ACCESS(read_only, 2) -INLINE int str_str(const str *s, const char *sub); +INLINE ssize_t str_str(const str *s, const char *sub); /* swaps the contents of two str objects */ __attribute__((nonnull(1, 2))) ACCESS(read_write, 1) @@ -395,7 +395,7 @@ INLINE str *g_string_free_str(GString *gs) { INLINE int str_memcmp(const str *s, const void *m) { return memcmp(s->s, m, s->len); } -INLINE int str_str(const str *s, const char *sub) { +INLINE ssize_t str_str(const str *s, const char *sub) { void *p = memmem(s->s, s->len, sub, strlen(sub)); if (!p) return -1;