zeroconf: eliminated strlen() usage from initZeroconf()
To test if a string is empty, we can just see if the first byte is 0. No need to include string.h for strlen() here.
This commit is contained in:
@@ -22,8 +22,6 @@
|
|||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
/* The default service name to publish
|
/* The default service name to publish
|
||||||
* (overridden by 'zeroconf_name' config parameter)
|
* (overridden by 'zeroconf_name' config parameter)
|
||||||
*/
|
*/
|
||||||
@@ -47,7 +45,7 @@ void initZeroconf(void)
|
|||||||
|
|
||||||
param = getConfigParam(CONF_ZEROCONF_NAME);
|
param = getConfigParam(CONF_ZEROCONF_NAME);
|
||||||
|
|
||||||
if (param && strlen(param->value) > 0)
|
if (param && *param->value != 0)
|
||||||
serviceName = param->value;
|
serviceName = param->value;
|
||||||
|
|
||||||
#ifdef HAVE_AVAHI
|
#ifdef HAVE_AVAHI
|
||||||
|
Reference in New Issue
Block a user