summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Thiago Macieira <thiago@macieira.org>2013-12-19 17:03:25 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-20 09:53:05 -0800
commit3e3fff262e90dde3c0db5e13de057f10753089fd (patch)
tree0f36176156a37b28431e45b1dde58182d9e35c5a /qt-ui
parent64f24234ab268aae601880a6f8a0fa9d2b4ce4d4 (diff)
downloadsubsurface-3e3fff262e90dde3c0db5e13de057f10753089fd.tar.gz
Don't use an array where none are necessary
We don't need to keep the array of zip_source structs. We just need the latest we created so we can add to the zip file. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/subsurfacewebservices.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp
index b78b57b01..2a2d2b370 100644
--- a/qt-ui/subsurfacewebservices.cpp
+++ b/qt-ui/subsurfacewebservices.cpp
@@ -133,7 +133,7 @@ bool DivelogsDeWebServices::prepare_dives_for_divelogs(const QString &tempfile,
int streamsize;
char *membuf;
xmlDoc *transformed;
- struct zip_source *s[dive_table.nr];
+ struct zip_source *s;
/*
* Get the i'th dive in XML format so we can process it.
@@ -187,9 +187,9 @@ bool DivelogsDeWebServices::prepare_dives_for_divelogs(const QString &tempfile,
* Save the XML document into a zip file.
*/
snprintf(filename, PATH_MAX, "%d.xml", i + 1);
- s[i] = zip_source_buffer(zip, membuf, streamsize, 1);
- if (s[i]) {
- int64_t ret = zip_add(zip, filename, s[i]);
+ s = zip_source_buffer(zip, membuf, streamsize, 1);
+ if (s) {
+ int64_t ret = zip_add(zip, filename, s);
if (ret == -1)
qDebug() << errPrefix << "failed to include dive:" << i;
}