hmmst'd've

This commit is contained in:
XANTRONIX Development 2019-05-07 22:16:40 -05:00
parent 59e482d27d
commit 4bfbd754ea
2 changed files with 4 additions and 3 deletions

View file

@ -8,7 +8,7 @@ CFLAGS += -I$(INCLUDE_PATH)
LDFLAGS = -L../src -lhexagram
STATIC = ../src/libhexagram.a
EXAMPLES = duration view
EXAMPLES = view
RM = /bin/rm

View file

@ -22,6 +22,7 @@ ssize_t hexagram_pcapng_read_options(hexagram_pcapng_stream *stream,
while (total < len) {
ssize_t readlen;
size_t remaining;
if ((readlen = read(stream->fd, &option, sizeof(option))) < 0) {
stream->error = HEXAGRAM_PCAPNG_ERROR_IO;
@ -41,8 +42,8 @@ ssize_t hexagram_pcapng_read_options(hexagram_pcapng_stream *stream,
total += readlen;
}
if (option.length % sizeof(uint32_t)) {
size_t padding = sizeof(uint32_t) - (option.length % sizeof(uint32_t));
if ((remaining = option.length % sizeof(uint32_t)) > 0) {
size_t padding = sizeof(uint32_t) - remaining;
if ((readlen = lseek(stream->fd, padding, SEEK_CUR)) < 0) {
goto error_io;