mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +00:00
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>
This commit is contained in:
parent
ecc8c1d995
commit
62e4c4069b
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue