From c06a1a4df70d3feebb5fef98bd5fde3bc7d55789 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 23 Oct 2011 19:27:57 +0200 Subject: [PATCH] use BUFSIZ --- document.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/document.c b/document.c index 11c1f6d..8bfb1b1 100644 --- a/document.c +++ b/document.c @@ -164,15 +164,14 @@ guess_type(const char* path) } const int fd = fileno(f); - static const size_t BLKSIZE = 4096; guchar* content = NULL; size_t length = 0u; while (uncertain == TRUE) { g_free((void*)content_type); content_type = NULL; - content = g_realloc(content, length + BLKSIZE); - const ssize_t r = read(fd, content + length, BLKSIZE); + content = g_realloc(content, length + BUFSIZ); + const ssize_t r = read(fd, content + length, BUFSIZ); if (r == -1) { break; }