#include "misc.h"
-
#define MAXMESGSIZE 199
/* this is only used by afpd children, so it's okay. */
uid_t euid;
uint32_t maxmsgsize;
- maxmsgsize = (obj->proto == AFPPROTO_DSI)?MIN(MAX(((DSI*)obj->handle)->attn_quantum, MAXMESGSIZE),MAXPATHLEN):MAXMESGSIZE;
+ maxmsgsize = MIN(MAX(obj->dsi->attn_quantum, MAXMESGSIZE), MAXPATHLEN);
i=0;
/* Construct file name SERVERTEXT/message.[pid] */
*rbuflen = 0;
- msgsize = (obj->proto == AFPPROTO_DSI)?MAX(((DSI*)obj->handle)->attn_quantum, MAXMESGSIZE):MAXMESGSIZE;
+ msgsize = MAX(obj->dsi->attn_quantum, MAXMESGSIZE);
memcpy(&type, ibuf + 2, sizeof(type));
memcpy(&bitmap, ibuf + 4, sizeof(bitmap));
* it has asked the login msg...
* Workaround: concatenate the two if any, ugly.
*/
- if (*message && *obj->options.loginmesg) {
- strlcat(message, " - ", MAXMESGSIZE);
+ if (obj->options.loginmesg) {
+ if (*message)
+ strlcat(message, " - ", MAXMESGSIZE);
+ strlcat(message, obj->options.loginmesg, MAXMESGSIZE);
}
- strlcat(message, obj->options.loginmesg, MAXMESGSIZE);
break;
case AFPMESG_SERVER: /* server */
break;