Skip to content

Commit

Permalink
dns_sd: don't require C99
Browse files Browse the repository at this point in the history
  • Loading branch information
abrasive committed Oct 21, 2013
1 parent 82518dc commit e074967
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mdns_dns_sd.c
Expand Up @@ -34,10 +34,11 @@ static DNSServiceRef service;
static int mdns_dns_sd_register(char *apname, int port) {
const char *record[] = { MDNS_RECORD, NULL };
uint16_t length = 0;
const char **field;

// Concatenate string contained i record into buf.

for (const char **field = record; *field; field ++)
for (field = record; *field; field ++)
{
length += strlen(*field) + 1; // One byte for length each time
}
Expand All @@ -51,7 +52,7 @@ static int mdns_dns_sd_register(char *apname, int port) {

char *p = buf;

for (const char **field = record; *field; field ++)
for (field = record; *field; field ++)
{
char * newp = stpcpy(p + 1, *field);
*p = newp - p - 1;
Expand Down

0 comments on commit e074967

Please sign in to comment.