diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2015-02-17 17:25:28 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2015-02-17 17:25:28 +0100 |
commit | 9a390acd44203dc7847ad05d86ac07082336c7fe (patch) | |
tree | acf10a650982b9b5c90e49ee35b661f46bc84bb3 /util.h | |
parent | 4bcd6157b2b44e700dd824d58248f4a98b2c536e (diff) |
llmnr-query: Add simple LLMNR query program
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -21,6 +21,7 @@ #define UTIL_H #include <stdarg.h> +#include <stdbool.h> #include <stdio.h> #include <stdlib.h> @@ -55,4 +56,16 @@ void *xzalloc(size_t size); void *xrealloc(void *ptr, size_t size); char *xstrdup(const char *s); +static inline bool xstreq(const char *str1, const char *str2) +{ + size_t n = strlen(str1); + + if (n != strlen(str2)) + return false; + if (strncmp(str1, str2, n) != 0) + return false; + + return true; +} + #endif /* UTIL_H */ |