From 0cfb5c4ba1be73fffdffad353dd6ebbcc717cde9 Mon Sep 17 00:00:00 2001 From: mpi Date: Tue, 27 Feb 2024 12:38:12 +0000 Subject: [PATCH] Make it possible to check for existing string in maps. --- usr.sbin/btrace/btrace.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.sbin/btrace/btrace.c b/usr.sbin/btrace/btrace.c index 4450e98b83a..ce32989be91 100644 --- a/usr.sbin/btrace/btrace.c +++ b/usr.sbin/btrace/btrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: btrace.c,v 1.88 2024/02/24 19:42:54 mpi Exp $ */ +/* $OpenBSD: btrace.c,v 1.89 2024/02/27 12:38:12 mpi Exp $ */ /* * Copyright (c) 2019 - 2023 Martin Pieuchot @@ -1640,6 +1640,9 @@ ba2long(struct bt_arg *ba, struct dt_evt *dtev) long val; switch (ba->ba_type) { + case B_AT_STR: + val = (*ba2str(ba, dtev) == '\0') ? 0 : 1; + break; case B_AT_LONG: val = (long)ba->ba_value; break; -- 2.20.1