Browse Source

MT#55283 fix str_str return type

Change-Id: I297199255b0d5204b0f978dc7306da8f2b6e6e34
(cherry picked from commit 9262cac855)
(cherry picked from commit adabb7aeac)
(cherry picked from commit c4fbb8d7b7)
mr12.5.1
Richard Fuchs 11 months ago
parent
commit
e742dbfc3f
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      lib/str.h

+ 2
- 2
lib/str.h View File

@ -138,7 +138,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)
@ -411,7 +411,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;


Loading…
Cancel
Save