From 5c54bad89db9de13c462dbd9f3e47294af3dc6ba Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 27 Jul 2022 10:47:11 +0200 Subject: [PATCH] std-aux: add nm_memeq() helper --- src/libnm-std-aux/nm-std-aux.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libnm-std-aux/nm-std-aux.h b/src/libnm-std-aux/nm-std-aux.h index 02a2942f8f..2ebfb1ade9 100644 --- a/src/libnm-std-aux/nm-std-aux.h +++ b/src/libnm-std-aux/nm-std-aux.h @@ -498,6 +498,12 @@ nm_memcmp(const void *s1, const void *s2, size_t n) return memcmp(s1, s2, n); } +static inline bool +nm_memeq(const void *s1, const void *s2, size_t len) +{ + return nm_memcmp(s1, s2, len) == 0; +} + /* * Very similar to g_str_has_prefix() with the obvious meaning. * Differences: