bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fix misalignment


From: Andreas Schwab
Subject: Fix misalignment
Date: Mon, 23 Jul 2007 15:08:35 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (gnu/linux)

2007-07-23  Andreas Schwab  <address@hidden>

        * src/sort.c (fillbuf): Make sure the buffer limit is always
        aligned after the buffer was grown.

diff --git a/src/sort.c b/src/sort.c
index 824dd0d..6024be7 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -1492,6 +1492,8 @@ fillbuf (struct buffer *buf, FILE *fp, char const *file)
       /* The current input line is too long to fit in the buffer.
         Double the buffer size and try again.  */
       buf->buf = X2REALLOC (buf->buf, &buf->alloc);
+      /* Realign buffer limit.  */
+      buf->alloc -= buf->alloc % sizeof (struct line);
     }
 }
 

Andreas.

-- 
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]