mem: add mem helper functions
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 4 lines
Quoted 1 line
+static inline char *memeq(const void *a,
size_tal, const void *b,size_tbl)This should have type 'bool', not char *, surely?
Whoops
Quoted 8 lines
Review
Quoted 6 lines
(quoted diff) +6
-0+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