The following commit has been merged in the master branch:
commit 0e0f59a882ce329de880d4a75f30787e261e2cb3
Author: Jonathan Nieder <jrnie...@gmail.com>
Date:   Sat May 7 11:33:42 2011 +0200

    libdpkg: Use new DPKG_BUFFER_SIZE macro instead of hard-coded literal
    
    Signed-off-by: Jonathan Nieder <jrnie...@gmail.com>
    Signed-off-by: Guillem Jover <guil...@debian.org>

diff --git a/lib/dpkg/buffer.h b/lib/dpkg/buffer.h
index c81ef1c..436a22e 100644
--- a/lib/dpkg/buffer.h
+++ b/lib/dpkg/buffer.h
@@ -30,6 +30,8 @@
 
 DPKG_BEGIN_DECLS
 
+#define DPKG_BUFFER_SIZE 4096
+
 #define BUFFER_WRITE_VBUF              1
 #define BUFFER_WRITE_FD                        2
 #define BUFFER_WRITE_NULL              3
diff --git a/lib/dpkg/compress.c b/lib/dpkg/compress.c
index 2bf53c5..eb01c5e 100644
--- a/lib/dpkg/compress.c
+++ b/lib/dpkg/compress.c
@@ -105,7 +105,7 @@ struct compressor compressor_none = {
 static void
 decompress_gzip(int fd_in, int fd_out, const char *desc)
 {
-       char buffer[4096];
+       char buffer[DPKG_BUFFER_SIZE];
        gzFile gzfile = gzdopen(fd_in, "r");
 
        if (gzfile == NULL)
@@ -139,7 +139,7 @@ decompress_gzip(int fd_in, int fd_out, const char *desc)
 static void
 compress_gzip(int fd_in, int fd_out, int compress_level, const char *desc)
 {
-       char buffer[4096];
+       char buffer[DPKG_BUFFER_SIZE];
        char combuf[6];
        int err;
        gzFile gzfile;
@@ -213,7 +213,7 @@ struct compressor compressor_gzip = {
 static void
 decompress_bzip2(int fd_in, int fd_out, const char *desc)
 {
-       char buffer[4096];
+       char buffer[DPKG_BUFFER_SIZE];
        BZFILE *bzfile = BZ2_bzdopen(fd_in, "r");
 
        if (bzfile == NULL)
@@ -247,7 +247,7 @@ decompress_bzip2(int fd_in, int fd_out, const char *desc)
 static void
 compress_bzip2(int fd_in, int fd_out, int compress_level, const char *desc)
 {
-       char buffer[4096];
+       char buffer[DPKG_BUFFER_SIZE];
        char combuf[6];
        int err;
        BZFILE *bzfile;

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to