Tidy up with a clang-format

This commit is contained in:
Mike Brady
2016-09-11 10:35:53 +01:00
parent 6bf0a1d483
commit 064bd293c5
29 changed files with 2907 additions and 2885 deletions
+17 -16
View File
@@ -24,15 +24,15 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <ifaddrs.h>
#include <unistd.h>
#include <netinet/in.h>
#include "common.h"
#include "mdns.h"
#include "common.h"
#include <ifaddrs.h>
#include <net/if.h>
#include <netinet/in.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include "tinysvcmdns.h"
@@ -124,22 +124,23 @@ static int mdns_tinysvcmdns_register(char *apname, int port) {
#endif
txt = txtwithoutmetadata;
if (config.regtype == NULL)
die("tinysvcmdns: regtype is null");
char* extendedregtype = malloc(strlen(config.regtype)+strlen(".local")+1);
char *extendedregtype = malloc(strlen(config.regtype) + strlen(".local") + 1);
if (extendedregtype==NULL)
if (extendedregtype == NULL)
die("tinysvcmdns: could not allocated memory to request a Zeroconf service");
strcpy(extendedregtype,config.regtype);
strcat(extendedregtype,".local");
struct mdns_service *svc = mdnsd_register_svc(svr, apname, extendedregtype, port, NULL,
strcpy(extendedregtype, config.regtype);
strcat(extendedregtype, ".local");
struct mdns_service *svc =
mdnsd_register_svc(svr, apname, extendedregtype, port, NULL,
(const char **)txt); // TTL should be 75 minutes, i.e. 4500 seconds
mdns_service_destroy(svc);
free(extendedregtype);
return 0;