Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165717
b: refs/heads/master
c: 6a88116
h: refs/heads/master
i:
  165715: 2ca1161
v: v3
  • Loading branch information
Phillip Lougher authored and Linus Torvalds committed Sep 24, 2009
1 parent 1851d04 commit 64e5504
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3354f73b24c6d392ed7fd5583cfcc7604c1934ae
refs/heads/master: 6a8811629e9aa611aa710162f9e02020bba52c87
8 changes: 8 additions & 0 deletions trunk/lib/decompress_inflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@

#define GZIP_IOBUF_SIZE (16*1024)

static int nofill(void *buffer, unsigned int len)
{
return -1;
}

/* Included from initramfs et al code */
STATIC int INIT gunzip(unsigned char *buf, int len,
int(*fill)(void*, unsigned int),
Expand Down Expand Up @@ -76,6 +81,9 @@ STATIC int INIT gunzip(unsigned char *buf, int len,
goto gunzip_nomem4;
}

if (!fill)
fill = nofill;

if (len == 0)
len = fill(zbuf, GZIP_IOBUF_SIZE);

Expand Down
10 changes: 9 additions & 1 deletion trunk/lib/decompress_unlzma.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ struct rc {
#define RC_MODEL_TOTAL_BITS 11


static int nofill(void *buffer, unsigned int len)
{
return -1;
}

/* Called twice: once at startup and once in rc_normalize() */
static void INIT rc_read(struct rc *rc)
{
Expand All @@ -97,7 +102,10 @@ static inline void INIT rc_init(struct rc *rc,
int (*fill)(void*, unsigned int),
char *buffer, int buffer_size)
{
rc->fill = fill;
if (fill)
rc->fill = fill;
else
rc->fill = nofill;
rc->buffer = (uint8_t *)buffer;
rc->buffer_size = buffer_size;
rc->buffer_end = rc->buffer + rc->buffer_size;
Expand Down

0 comments on commit 64e5504

Please sign in to comment.