Re: [PATCH v3 1/3] mem: add mem helper functions

Cody P Schafer <[email protected]>
Newsgroups org.ozlabs.lists.ccan
Message-ID <CAPoQQ-2VFic+8BTji+6qt+Mz7-BKQQ6oxwbXBf-+s=+f=SrZ+A@mail.gmail.com>
>> +static inline char *memeq(const void *a, size_t al, const void *b, size_t bl)
>
> This should have type 'bool', not char *, surely?
>

Whoops

>> +static inline bool memends(const void *s, size_t s_len, const void *suffix, size_t suffix_len)
>> +{
>> +     return (s_len >= suffix_len) && (memcmp((const char *)s + s_len - suffix_len,
>> +                                             suffix, suffix_len) == 0);
>> +}
>> +
>
> memends_str() for symmetry?

I didn't need it, but that does make sense.

I'll send out a fixed-up changeset shortly.
_______________________________________________
ccan mailing list
[email protected]
https://lists.ozlabs.org/listinfo/ccan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.