summaryrefslogtreecommitdiff
path: root/ext/zip/lib/zip_source_buffer.c
diff options
context:
space:
mode:
authorSean Finney <seanius@debian.org>2009-04-10 14:09:48 +0200
committerSean Finney <seanius@debian.org>2009-04-10 14:09:48 +0200
commitcd0b49c72aee33b3e44a9c589fcd93b9e1c7a64f (patch)
tree1315c623bb7d9dfa8d366fa9cd2c6834ceeb5da5 /ext/zip/lib/zip_source_buffer.c
parent9ea47aab740772adf0c69d8c94b208a464e599ea (diff)
downloadphp-cd0b49c72aee33b3e44a9c589fcd93b9e1c7a64f.tar.gz
Imported Upstream version 5.2.9.dfsg.1upstream/5.2.9.dfsg.1
Diffstat (limited to 'ext/zip/lib/zip_source_buffer.c')
-rw-r--r--ext/zip/lib/zip_source_buffer.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/ext/zip/lib/zip_source_buffer.c b/ext/zip/lib/zip_source_buffer.c
index 95875b74c..867d3dfa3 100644
--- a/ext/zip/lib/zip_source_buffer.c
+++ b/ext/zip/lib/zip_source_buffer.c
@@ -1,11 +1,9 @@
/*
- $NiH: zip_source_buffer.c,v 1.8 2006/04/23 14:50:49 wiz Exp $
-
zip_source_buffer.c -- create zip data source from buffer
- Copyright (C) 1999-2008 Dieter Baron and Thomas Klausner
+ Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP archives.
- The authors can be contacted at <nih@giga.or.at>
+ The authors can be contacted at <libzip@nih.at>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -38,7 +36,6 @@
#include <stdlib.h>
#include <string.h>
-#include "zip.h"
#include "zipint.h"
struct read_data {
@@ -52,7 +49,7 @@ static ssize_t read_data(void *state, void *data, size_t len,
-PHPZIPAPI struct zip_source *
+ZIP_EXTERN(struct zip_source *)
zip_source_buffer(struct zip *za, const void *data, off_t len, int freep)
{
struct read_data *f;
@@ -84,6 +81,8 @@ zip_source_buffer(struct zip *za, const void *data, off_t len, int freep)
return zs;
}
+
+
static ssize_t
read_data(void *state, void *data, size_t len, enum zip_source_cmd cmd)
{
@@ -103,8 +102,6 @@ read_data(void *state, void *data, size_t len, enum zip_source_cmd cmd)
n = z->end - z->buf;
if (n > len)
n = len;
- if (n < 0)
- n = 0;
if (n) {
memcpy(buf, z->buf, n);