summaryrefslogtreecommitdiff
path: root/src/htszlib.c
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2012-05-07 10:02:58 +0000
committerXavier Roche <xroche@users.noreply.github.com>2012-05-07 10:02:58 +0000
commit525118dfe8bb3f6b874db7920dc0ee04eede0585 (patch)
treec2f57a84561e427c09ea7a248f438c187a004c58 /src/htszlib.c
parentaad35562b3293c792e858b36c3ca7d1ab2f386c6 (diff)
Charset fixes
Diffstat (limited to 'src/htszlib.c')
-rw-r--r--src/htszlib.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/htszlib.c b/src/htszlib.c
index 4fd33da..d313d89 100644
--- a/src/htszlib.c
+++ b/src/htszlib.c
@@ -54,13 +54,16 @@ Please visit our Website: http://www.httrack.com
Unpack file into a new file
Return value: size of the new file, or -1 if an error occured
*/
+/* Note: utf-8 */
int hts_zunpack(char* filename,char* newfile) {
+ int ret = -1;
char catbuff[CATBUFF_SIZE];
if (gz_is_available && filename && newfile) {
if (filename[0] && newfile[0]) {
- gzFile gz = gzopen (filename, "rb");
+ // not: NOT an UTF-8 filename
+ gzFile gz = gzopen(filename, "rb");
if (gz) {
- FILE* fpout=fopen(fconv(catbuff, newfile),"wb");
+ FILE*const fpout = FOPEN(fconv(catbuff, newfile), "wb");
int size=0;
if (fpout) {
int nr;
@@ -77,11 +80,11 @@ int hts_zunpack(char* filename,char* newfile) {
} else
size=-1;
gzclose(gz);
- return (int) size;
+ ret = (int) size;
}
}
}
- return -1;
+ return ret;
}
int hts_extract_meta(const char* path) {