summaryrefslogtreecommitdiffstats
path: root/fastwriter.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2016-03-04 16:45:54 +0100
committerSuren A. Chilingaryan <csa@suren.me>2016-03-04 16:45:54 +0100
commit5460cc187513c48661d8b6b2bc0251c8900d44a0 (patch)
tree95d74b84fcebb00be0d53a49afb9fbe79120958a /fastwriter.c
parentc0326277fc2ee0436621904c9f968a3312ae9c10 (diff)
downloadfastwriter-5460cc187513c48661d8b6b2bc0251c8900d44a0.tar.gz
fastwriter-5460cc187513c48661d8b6b2bc0251c8900d44a0.tar.bz2
fastwriter-5460cc187513c48661d8b6b2bc0251c8900d44a0.tar.xz
fastwriter-5460cc187513c48661d8b6b2bc0251c8900d44a0.zip
RPM support
Diffstat (limited to 'fastwriter.c')
-rw-r--r--fastwriter.c4
1 files changed, 2 insertions, 2 deletions
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;