Fix HEADER_SIZE check, fix static_assert fallback

This commit is contained in:
Wirtos_new 2021-06-17 15:43:21 +03:00
parent 2088adcdc1
commit 1aa0ea60da
2 changed files with 2 additions and 2 deletions

View file

@ -11,7 +11,7 @@
#include "util/str_util.h"
#ifndef static_assert
#define static_assert(x, msg) (void) sizeof(struct {int a[(x) ? 1 : -1]})
#define static_assert(x, msg) (void) sizeof(struct {int a[(x) ? 1 : -1]; })
#endif
void

View file

@ -36,7 +36,7 @@ stream_recv_packet(struct stream *stream, AVPacket *packet) {
uint8_t header[HEADER_SIZE];
size_t r = net_recv_all(stream->socket, header, HEADER_SIZE);
if (r < HEADER_SIZE) {
if (r == (size_t)-1 || r < HEADER_SIZE) {
return false;
}