Fix -Wmissing-field-initializers
This commit is contained in:
@@ -160,14 +160,14 @@ struct CloseFrame {
|
||||
|
||||
static inline CloseFrame parseClosePayload(char *src, size_t length) {
|
||||
/* If we get no code or message, default to reporting 1005 no status code present */
|
||||
CloseFrame cf = {1005};
|
||||
CloseFrame cf = {1005, nullptr, 0};
|
||||
if (length >= 2) {
|
||||
memcpy(&cf.code, src, 2);
|
||||
cf = {cond_byte_swap<uint16_t>(cf.code), src + 2, length - 2};
|
||||
if (cf.code < 1000 || cf.code > 4999 || (cf.code > 1011 && cf.code < 4000) ||
|
||||
(cf.code >= 1004 && cf.code <= 1006) || !isValidUtf8((unsigned char *) cf.message, cf.length)) {
|
||||
/* Even though we got a WebSocket close frame, it in itself is abnormal */
|
||||
return {1006};
|
||||
return {1006, nullptr, 0};
|
||||
}
|
||||
}
|
||||
return cf;
|
||||
|
||||
Reference in New Issue
Block a user