mumble/0001-if-service-name-is-empty-don-t-pass-an-empty-string.diff

29 lines
1.2 KiB
Diff

From d2a97b874e55ad156781a2762ff32ae9566de495 Mon Sep 17 00:00:00 2001
From: Ludwig Nussel <ludwig.nussel@suse.de>
Date: Thu, 24 Mar 2011 09:04:53 +0100
Subject: [PATCH mumble] if service name is empty don't pass an empty string
DNSServiceRegister uses the local host name if the name is NULL but does nothing if it's empty
---
src/bonjour/bonjourserviceregister.cpp | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/bonjour/bonjourserviceregister.cpp b/src/bonjour/bonjourserviceregister.cpp
index a818d8c..5f82779 100644
--- a/src/bonjour/bonjourserviceregister.cpp
+++ b/src/bonjour/bonjourserviceregister.cpp
@@ -53,7 +53,9 @@ void BonjourServiceRegister::registerService(const BonjourRecord &record, quint1
}
#endif
- DNSServiceErrorType err = DNSServiceRegister(&dnssref, 0, 0, record.serviceName.toUtf8().constData(),
+ DNSServiceErrorType err = DNSServiceRegister(&dnssref, 0, 0,
+ record.serviceName.isEmpty() ? 0
+ : record.serviceName.toUtf8().constData(),
record.registeredType.toUtf8().constData(),
record.replyDomain.isEmpty() ? 0
: record.replyDomain.toUtf8().constData(), 0,
--
1.7.3.4