Skip to content

Instantly share code, notes, and snippets.

@jgehring
Created April 2, 2012 11:56
Show Gist options
  • Select an option

  • Save jgehring/2282977 to your computer and use it in GitHub Desktop.

Select an option

Save jgehring/2282977 to your computer and use it in GitHub Desktop.
Fixed return value check in snappy_uncompress_iov()
diff --git a/snappy.c b/snappy.c
index 3f0e159..aba8990 100644
--- a/snappy.c
+++ b/snappy.c
@@ -1383,7 +1383,7 @@ bool snappy_uncompress_iov(struct iovec *iov_in, int iov_in_len,
.base = uncompressed,
.op = uncompressed
};
- return internal_uncompress(&reader, &output, 0xffffffff);
+ return (internal_uncompress(&reader, &output, 0xffffffff) == 0);
}
EXPORT_SYMBOL(snappy_uncompress_iov);
@@ -1467,7 +1467,7 @@ bool snappy_uncompress(const char *compressed, size_t n, char *uncompressed)
.base = uncompressed,
.op = uncompressed
};
- return internal_uncompress(&reader, &output, 0xffffffff);
+ return (internal_uncompress(&reader, &output, 0xffffffff) == 0);
}
EXPORT_SYMBOL(snappy_uncompress);
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment