]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
msgfilter: Simplify the last commit
authorDaiki Ueno <ueno@gnu.org>
Fri, 28 Nov 2014 05:42:25 +0000 (14:42 +0900)
committerDaiki Ueno <ueno@gnu.org>
Fri, 28 Nov 2014 05:43:49 +0000 (14:43 +0900)
* msgfilter.c (prepare_read): Simplify the last commit 06e206f5,
by always adding 1 to the buffer size.

gettext-tools/src/ChangeLog
gettext-tools/src/msgfilter.c

index 1fdff820effdb2e7a8b899472c3a087f178484fc..e45bbc5f8bf4bfd00f722cb4a950c12c201ff546 100644 (file)
@@ -1,3 +1,8 @@
+2014-11-28  Daiki Ueno  <ueno@gnu.org>
+
+       * msgfilter.c (prepare_read): Simplify the last commit 06e206f5,
+       by always adding 1 to the buffer size.
+
 2014-11-28  Daiki Ueno  <ueno@gnu.org>
 
        msgfilter: Fix read buffer allocation for empty input
index 5daced43e0c2c4c75b81785e8dd55e5500d6fadb..f9cb1cc28b1461edeed794a7e7c7f2d4b0de18da 100644 (file)
@@ -554,8 +554,7 @@ prepare_read (size_t *num_bytes_p, void *private_data)
 
   if (l->length == l->allocated)
     {
-      l->allocated = l->allocated
-        + (l->allocated < 2 ? 1 : (l->allocated >> 1));
+      l->allocated = l->allocated + (l->allocated >> 1) + 1;
       l->result = (char *) xrealloc (l->result, l->allocated);
     }
   *num_bytes_p = l->allocated - l->length;