X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fstatus.c;h=8147a038bc687e65787b3cd092b35c06c715bae5;hb=ff3b4646472add7902b0d36dd1a941ec1a54e999;hp=d4247829345d01a298e86baeafab64918c52d0de;hpb=088f8c044eae0a2e77576ae09bc9cf93e3deb08b;p=netatalk.git diff --git a/etc/afpd/status.c b/etc/afpd/status.c index d4247829..8147a038 100644 --- a/etc/afpd/status.c +++ b/etc/afpd/status.c @@ -133,15 +133,19 @@ static void status_machine(char *data) #ifdef AFS const char *machine = "afs"; #else /* !AFS */ - const char *machine = "Netatalk"; + const char *machine = "Netatalk %s"; #endif /* AFS */ + char buf[64]; memcpy(&status, start + AFPSTATUS_MACHOFF, sizeof(status)); data += ntohs( status ); - len = strlen( machine ); + + // len = strlen( machine ); + len = snprintf(buf, 64, machine, VERSION); *data++ = len; - memcpy( data, machine, len ); + memcpy( data, buf, len ); data += len; + status = htons(data - start); memcpy(start + AFPSTATUS_VERSOFF, &status, sizeof(status)); } @@ -556,7 +560,7 @@ void set_signature(struct afp_options *options) { char *servername_conf; int header = 0; char buf[1024], *p; - FILE *fp, *randomp; + FILE *fp = NULL, *randomp; size_t len; char *server_tmp;