- struct {
- user_req_header req;
- char arg[arg_len];
- } reqdata;
- reqdata.req.version = NSCD_VERSION;
- reqdata.req.type = INVALIDATE;
- reqdata.req.key_len = arg_len;
- memcpy(reqdata.arg, arg, arg_len);
- xfull_write(sock, &reqdata, arg_len + sizeof(ureq));
+ char buf[sizeof(user_req_header) + arg_len];
+ user_req_header *req = (void*) buf;
+
+ req->version = NSCD_VERSION;
+ req->type = INVALIDATE;
+ req->key_len = arg_len;
+ memcpy(req + 1, arg, arg_len);
+ xfull_write(sock, req, sizeof(*req) + arg_len);