summaryrefslogtreecommitdiffstats
path: root/src/io
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2016-03-14 16:37:50 +0000
committerJabiertxof <jtx@jtx.marker.es>2016-03-14 16:37:50 +0000
commitb8d22beef5345210ad27cdc2685083aeae6f8f3b (patch)
treed69b8bfd19d3627a8425a1b265c2abf229b05354 /src/io
parentfixes for update to trunk (diff)
parent"Relative to" option for node alignment. (diff)
downloadinkscape-b8d22beef5345210ad27cdc2685083aeae6f8f3b.tar.gz
inkscape-b8d22beef5345210ad27cdc2685083aeae6f8f3b.zip
update to trunk
(bzr r13708.1.39)
Diffstat (limited to 'src/io')
-rw-r--r--src/io/inkjar.cpp17
-rw-r--r--src/io/streamtest.cpp1
2 files changed, 12 insertions, 6 deletions
diff --git a/src/io/inkjar.cpp b/src/io/inkjar.cpp
index fb1fedf55..345455c4a 100644
--- a/src/io/inkjar.cpp
+++ b/src/io/inkjar.cpp
@@ -103,14 +103,19 @@ bool JarFile::init_inflation()
bool JarFile::open()
{
+ if (_file != NULL) {
+ fclose(_file);
+ }
if ((_file = fopen(_filename, "r")) == NULL) {
- fprintf(stderr, "open failed.\n");
- return false;
+ fprintf(stderr, "open failed.\n");
+ return false;
+ }
+ if (!init_inflation()) {
+ return false;
+ }
+ else {
+ return true;
}
- if (!init_inflation())
- return false;
-
- return true;
}
bool JarFile::close()
diff --git a/src/io/streamtest.cpp b/src/io/streamtest.cpp
index 2030e6a85..ec59ac4a6 100644
--- a/src/io/streamtest.cpp
+++ b/src/io/streamtest.cpp
@@ -202,6 +202,7 @@ void path_init(char *path, char *name)
exit(1);
}
strncpy(ptr+1,name,strlen(name)+1);
+ path[PATH_MAX-1] = '\0';
printf("'%s'\n",path);
}