From 00d5e6e9c7cb0462bddb4e679e531f6ce9a33c63 Mon Sep 17 00:00:00 2001
From: Max Kellermann <max.kellermann@gmail.com>
Date: Mon, 6 Mar 2023 19:57:53 +0100
Subject: [PATCH] lib/avahi/Publisher: use libfmt

---
 src/lib/avahi/Publisher.cxx | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/lib/avahi/Publisher.cxx b/src/lib/avahi/Publisher.cxx
index 41d4c491b..0bfe2b47e 100644
--- a/src/lib/avahi/Publisher.cxx
+++ b/src/lib/avahi/Publisher.cxx
@@ -13,9 +13,10 @@
 #include <avahi-common/malloc.h>
 #include <avahi-common/alternative.h>
 
+#include <fmt/core.h>
+
 #include <cassert>
 
-#include <stdio.h>
 #include <unistd.h>
 
 namespace Avahi {
@@ -31,11 +32,9 @@ namespace Avahi {
  * AVAHI_BROWSER_NEW.
  */
 static std::string
-MakePidName(const char *prefix)
+MakePidName(const char *prefix) noexcept
 {
-	char buffer[256];
-	snprintf(buffer, sizeof(buffer), "%s[%u]", prefix, (unsigned)getpid());
-	return buffer;
+	return fmt::format("{}[{}]", prefix, getpid());
 }
 
 Publisher::Publisher(Client &_client, const char *_name,