summaryrefslogtreecommitdiff
path: root/ext/zip/lib/zip_source_buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/zip/lib/zip_source_buffer.c')
-rw-r--r--ext/zip/lib/zip_source_buffer.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/ext/zip/lib/zip_source_buffer.c b/ext/zip/lib/zip_source_buffer.c
index 8a13e7602d..c81590ddcc 100644
--- a/ext/zip/lib/zip_source_buffer.c
+++ b/ext/zip/lib/zip_source_buffer.c
@@ -17,7 +17,7 @@
3. The names of the authors may not be used to endorse or promote
products derived from this software without specific prior
written permission.
-
+
THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -31,7 +31,7 @@
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
+
#include <stdlib.h>
#include <string.h>
@@ -46,7 +46,7 @@ struct read_data {
static zip_int64_t read_data(void *, void *, zip_uint64_t, enum zip_source_cmd);
-
+
ZIP_EXTERN struct zip_source *
zip_source_buffer(struct zip *za, const void *data, zip_uint64_t len, int freep)
@@ -71,7 +71,7 @@ zip_source_buffer(struct zip *za, const void *data, zip_uint64_t len, int freep)
f->end = ((const char *)data)+len;
f->freep = freep;
f->mtime = time(NULL);
-
+
if ((zs=zip_source_function(za, read_data, f)) == NULL) {
free(f);
return NULL;
@@ -80,7 +80,7 @@ zip_source_buffer(struct zip *za, const void *data, zip_uint64_t len, int freep)
return zs;
}
-
+
static zip_int64_t
read_data(void *state, void *data, zip_uint64_t len, enum zip_source_cmd cmd)
@@ -96,7 +96,7 @@ read_data(void *state, void *data, zip_uint64_t len, enum zip_source_cmd cmd)
case ZIP_SOURCE_OPEN:
z->buf = z->data;
return 0;
-
+
case ZIP_SOURCE_READ:
n = (zip_uint64_t)(z->end - z->buf);
if (n > len)
@@ -108,14 +108,14 @@ read_data(void *state, void *data, zip_uint64_t len, enum zip_source_cmd cmd)
}
return (zip_int64_t)n;
-
+
case ZIP_SOURCE_CLOSE:
return 0;
case ZIP_SOURCE_STAT:
{
struct zip_stat *st;
-
+
if (len < sizeof(*st))
return -1;
@@ -129,7 +129,7 @@ read_data(void *state, void *data, zip_uint64_t len, enum zip_source_cmd cmd)
st->encryption_method = ZIP_EM_NONE;
st->valid = ZIP_STAT_MTIME|ZIP_STAT_SIZE|ZIP_STAT_COMP_SIZE
|ZIP_STAT_COMP_METHOD|ZIP_STAT_ENCRYPTION_METHOD;
-
+
return sizeof(*st);
}