summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/main.c b/main.c
index 3ca4b3b9..d263a69f 100644
--- a/main.c
+++ b/main.c
@@ -271,12 +271,12 @@ fdesc(struct buf *blk, struct buf *ln,
* growable, hence passed in by ptr-ptr.
*/
- if (-1 == fstat(fd, &st)) {
+ sz = BUFSIZ;
+
+ if (-1 == fstat(fd, &st))
warnx("%s", f);
- sz = BUFSIZ;
- } else
- sz = (unsigned)BUFSIZ > st.st_blksize ?
- (size_t)BUFSIZ : st.st_blksize;
+ else if ((size_t)st.st_blksize > sz)
+ sz = st.st_blksize;
if (sz > blk->sz) {
blk->buf = realloc(blk->buf, sz);