/* Translate the error type and code into an ofperr. */
error = ofperr_decode(oh->version, vendor, type, code);
if (error && payload) {
- ofpbuf_init(payload, ofpbuf_size(&b));
- ofpbuf_push(payload, ofpbuf_data(&b), ofpbuf_size(&b));
+ ofpbuf_init(payload, b.size);
+ ofpbuf_push(payload, b.data, b.size);
}
return error;
}