#else /* !AFS */
const char *machine = "Netatalk %s";
#endif /* AFS */
- char buf[64];
+ char buf[AFPSTATUS_MACHLEN+1];
memcpy(&status, start + AFPSTATUS_MACHOFF, sizeof(status));
data += ntohs( status );
// len = strlen( machine );
- len = snprintf(buf, 64, machine, VERSION);
+ len = snprintf(buf, AFPSTATUS_MACHLEN+1, machine, VERSION);
*data++ = len;
memcpy( data, buf, len );
data += len;
#define AFPSTATUS_UAMSOFF 4
#define AFPSTATUS_ICONOFF 6
#define AFPSTATUS_FLAGOFF 8
+
/* AFPSTATUS_PRELEN is the number of bytes for status data prior to
* the ServerName field.
*
* UAMCount, VolumeIconAndMask, and the 16-bit "Fixed" status flags.
*/
#define AFPSTATUS_PRELEN 10
+
/* AFPSTATUS_POSTLEN is the number of bytes for offset records
* after the ServerName field.
*
#define AFPSTATUS_POSTLEN 8
#define AFPSTATUS_LEN (AFPSTATUS_PRELEN + AFPSTATUS_POSTLEN)
+/* AFPSTATUS_MACHLEN is the number of characters for the MachineType. */
+#define AFPSTATUS_MACHLEN 16
+
#define PASSWD_NONE 0
#define PASSWD_SET (1 << 0)