diff options
author | Remi Collet <remi@fedoraproject.org> | 2015-05-06 14:36:18 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2015-05-06 15:16:43 +0200 |
commit | 9e0cc7a1d926c1364a834177cadea431cd8b39a7 (patch) | |
tree | f63c505073d6aa0b74bde71eb6a67e6e4c23d8bd /ext/zip/lib/zip_error_strerror.c | |
parent | 31f516b4888fcf096fe0912828948bed84f2ad1c (diff) | |
download | php-git-9e0cc7a1d926c1364a834177cadea431cd8b39a7.tar.gz |
update libzip to version 1.0.1
Diffstat (limited to 'ext/zip/lib/zip_error_strerror.c')
-rw-r--r-- | ext/zip/lib/zip_error_strerror.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/ext/zip/lib/zip_error_strerror.c b/ext/zip/lib/zip_error_strerror.c index 74e49258dd..2f124ccd46 100644 --- a/ext/zip/lib/zip_error_strerror.c +++ b/ext/zip/lib/zip_error_strerror.c @@ -1,6 +1,6 @@ /* zip_error_sterror.c -- get string representation of struct zip_error - Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2014 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> @@ -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 @@ -32,7 +32,6 @@ */ - #include <errno.h> #include <stdio.h> #include <stdlib.h> @@ -41,14 +40,13 @@ #include "zipint.h" - -const char * -_zip_error_strerror(struct zip_error *err) +ZIP_EXTERN const char * +zip_error_strerror(zip_error_t *err) { const char *zs, *ss; char buf[128], *s; - _zip_error_fini(err); + zip_error_fini(err); if (err->zip_err < 0 || err->zip_err >= _zip_nerr_str) { sprintf(buf, "Unknown error %d", err->zip_err); @@ -57,7 +55,7 @@ _zip_error_strerror(struct zip_error *err) } else { zs = _zip_err_str[err->zip_err]; - + switch (_zip_err_type[err->zip_err]) { case ZIP_ET_SYS: ss = strerror(err->sys_err); @@ -78,7 +76,7 @@ _zip_error_strerror(struct zip_error *err) if ((s=(char *)malloc(strlen(ss) + (zs ? strlen(zs)+2 : 0) + 1)) == NULL) return _zip_err_str[ZIP_ER_MEMORY]; - + sprintf(s, "%s%s%s", (zs ? zs : ""), (zs ? ": " : ""), |