mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
cleanup: Unchecked return value from library
CID 60227 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This commit is contained in:
parent
ca7b0017a7
commit
dc714e582f
1 changed files with 18 additions and 3 deletions
|
@ -57,7 +57,12 @@ void ostctools_import(const char *file, struct dive_table *divetable)
|
|||
|
||||
// Read dive number from the log
|
||||
uc_tmp = calloc(2, 1);
|
||||
fseek(archive, 258, 0);
|
||||
if (fseek(archive, 258, 0) == -1) {
|
||||
report_error(failed_to_read_msg, file);
|
||||
free(uc_tmp);
|
||||
free(ostcdive);
|
||||
goto close_out;
|
||||
}
|
||||
if (fread(uc_tmp, 1, 2, archive) != 2) {
|
||||
report_error(failed_to_read_msg, file);
|
||||
free(uc_tmp);
|
||||
|
@ -69,7 +74,12 @@ void ostctools_import(const char *file, struct dive_table *divetable)
|
|||
|
||||
// Read device's serial number
|
||||
uc_tmp = calloc(2, 1);
|
||||
fseek(archive, 265, 0);
|
||||
if (fseek(archive, 265, 0) == -1) {
|
||||
report_error(failed_to_read_msg, file);
|
||||
free(uc_tmp);
|
||||
free(ostcdive);
|
||||
goto close_out;
|
||||
}
|
||||
if (fread(uc_tmp, 1, 2, archive) != 2) {
|
||||
report_error(failed_to_read_msg, file);
|
||||
free(uc_tmp);
|
||||
|
@ -80,7 +90,12 @@ void ostctools_import(const char *file, struct dive_table *divetable)
|
|||
free(uc_tmp);
|
||||
|
||||
// Read dive's raw data, header + profile
|
||||
fseek(archive, 456, 0);
|
||||
if (fseek(archive, 456, 0) == -1) {
|
||||
report_error(failed_to_read_msg, file);
|
||||
free(uc_tmp);
|
||||
free(ostcdive);
|
||||
goto close_out;
|
||||
}
|
||||
while ((c = getc(archive)) != EOF) {
|
||||
buffer[i] = c;
|
||||
if (buffer[i] == 0xFD && buffer[i - 1] == 0xFD)
|
||||
|
|
Loading…
Add table
Reference in a new issue