From 16bb9f263ca4c8015cd2b9ae9b78922a9fb190d3 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Fri, 20 Mar 2009 21:29:29 +0000 Subject: Casting fix. --- main.c | 10 +++++----- 1 file 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); -- cgit