From 8325d347d614548b0c5696393f48ecd7613f4473 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Tue, 14 Jan 2020 15:18:12 +0100 Subject: [PATCH] pam: Add str_equal() helper to copy/paste header --- pam/fingerprint-strings.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pam/fingerprint-strings.h b/pam/fingerprint-strings.h index a0668d8..00d2525 100644 --- a/pam/fingerprint-strings.h +++ b/pam/fingerprint-strings.h @@ -28,6 +28,15 @@ #define GNUC_UNUSED __attribute__((__unused__)) +static bool str_equal (const char *a, const char *b) +{ + if (a == NULL && b == NULL) + return true; + if (a == NULL || b == NULL) + return false; + return (strcmp (a, b) == 0); +} + struct { const char *dbus_name; const char *place_str_generic;