From 5460cc187513c48661d8b6b2bc0251c8900d44a0 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Fri, 4 Mar 2016 16:45:54 +0100 Subject: RPM support --- fastwriter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fastwriter.c') diff --git a/fastwriter.c b/fastwriter.c index 08722fa..dd48493 100644 --- a/fastwriter.c +++ b/fastwriter.c @@ -64,8 +64,8 @@ int fastwriter_open(fastwriter_t *ctx, const char *name, fastwriter_flags_t flag break; case FASTWRITER_BUFFER_MAX: ctx->size = fastwriter_get_free_memory(); - - if ((ctx->size - FASTWRITER_RESERVE_MEMORY) < FASTWRITER_DEFAULT_BUFFER_SIZE) + + if ((ctx->size == (size_t)-1)||((ctx->size - FASTWRITER_RESERVE_MEMORY) < FASTWRITER_DEFAULT_BUFFER_SIZE)) ctx->size = FASTWRITER_DEFAULT_BUFFER_SIZE; else ctx->size -= FASTWRITER_RESERVE_MEMORY; -- cgit v1.2.3