summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mcastseed/src/dgrambuf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mcastseed/src/dgrambuf.c b/mcastseed/src/dgrambuf.c
index 03f9ea0..a59f84f 100644
--- a/mcastseed/src/dgrambuf.c
+++ b/mcastseed/src/dgrambuf.c
@@ -414,7 +414,10 @@ ssize_t dgrambuf_write(dgrambuf_t dbuf, int fd, int *info) {
int dgrambuf_stats(dgrambuf_t dbuf, char **allocated_string) {
uint64_t dgram_pending = dgrambuf_get_used_count(dbuf);
- uint64_t dgram_missing = dbuf->dgram_seq_last - (dbuf->dgram_seq_base - 1) - dgram_pending;
+ uint64_t dgram_missing = 0;
+ if ( dbuf->dgram_seq_last ) {
+ dgram_missing = dbuf->dgram_seq_last - (dbuf->dgram_seq_base - 1) - dgram_pending;
+ }
return asprintf(allocated_string,
"dgrambuf_read_on_full==%d "