diff mbox series

[V2,2/6] Add utility to compare string

Message ID 20230512123504.160169-3-sbabic@denx.de
State Accepted
Headers show
Series Cleanup and include restruct | expand

Commit Message

Stefano Babic May 12, 2023, 12:35 p.m. UTC
IS_STR_EQUAL lets to write more simple string comparisons.

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 include/util.h | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/include/util.h b/include/util.h
index 2a07468..b39b069 100644
--- a/include/util.h
+++ b/include/util.h
@@ -136,6 +136,8 @@  void notifier_set_color(int level, char *col);
 } while (0)
 
 
+#define IS_STR_EQUAL(s,s1) (s && s1 && !strcmp(s,s1))
+
 #define LG_16 4
 #define FROM_HEX(f) from_ascii (f, sizeof f, LG_16)
 uintmax_t