diff options
author | Venkatesh Shukla <venkatesh.shukla.eee11@iitbhu.ac.in> | 2014-04-05 21:29:34 +0530 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-04-05 13:30:16 -0700 |
commit | 62e4c4069b517e97660452edd70f65d3cdb15e35 (patch) | |
tree | f7172b4481853903948cdfe1c7bf804cbacb017e | |
parent | ecc8c1d995be8b55e0a8a77d9676ede79fa22fb4 (diff) | |
download | subsurface-62e4c4069b517e97660452edd70f65d3cdb15e35.tar.gz |
Fix divelogs.de upload error
The order of arguments to fread was incorrect.
In case of arguments "streamsize, 1" the returning value is 1, and
hence due to membuf[streamsize] = 0; line, membuf ends up being one
character long.
Fixed it by exchanging arguments to "1, streamsize". This way,
streamsize has the correct value.
Fixes #483
Signed-off-by: Venkatesh Shukla <venkatesh.shukla.eee11@iitbhu.ac.in>
Acked-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-ui/subsurfacewebservices.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp index 707746573..a8bce4a72 100644 --- a/qt-ui/subsurfacewebservices.cpp +++ b/qt-ui/subsurfacewebservices.cpp @@ -159,7 +159,7 @@ bool DivelogsDeWebServices::prepare_dives_for_divelogs(const QString &tempfile, rewind(f); membuf = (char *)malloc(streamsize + 1); - if (!membuf || (streamsize = fread(membuf, streamsize, 1, f)) == 0) { + if (!membuf || (streamsize = fread(membuf, 1, streamsize, f)) == 0) { report_error(tr("internal error: %s").toUtf8(), qt_error_string().toUtf8().data()); fclose(f); free((void *)membuf); |