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

Cody P Schafer dev at codyps.com
Sun Sep 6 11:13:36 AEST 2015


>> +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.


More information about the ccan mailing list