Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
d751e261
Commit
d751e261
authored
Jun 02, 2015
by
Thomas Jahns
🤸
Browse files
Fix overflow and undefined symbol.
parent
ef7bc20e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/input_file.c
View file @
d751e261
#define _XOPEN_SOURCE 600
#include
"input_file.h"
#include
"cdi.h"
...
...
@@ -112,8 +113,8 @@ int cdiInputFile_read(const CdiInputFile* me, off_t readPosition, size_t readSiz
if
(
bytesRead
==
0
)
return
CDI_EEOF
;
byteBuffer
+=
bytesRead
;
readPosition
+=
bytesRead
;
readSize
-=
bytesRead
;
*
outActualReadSize
+=
bytesRead
;
readSize
-=
(
size_t
)
bytesRead
;
*
outActualReadSize
+=
(
size_t
)
bytesRead
;
}
return
CDI_NOERR
;
}
...
...
@@ -129,9 +130,8 @@ void cdiInputFile_destruct(CdiInputFile* me)
xassert
(
!
error
);
{
//Find the position of me in the list of open files.
ssize_t
position
;
for
(
position
=
openFileCount
;
position
--
;
)
if
(
openFileList
[
position
]
==
me
)
break
;
xassert
(
position
!=
-
1
);
ssize_t
position
=
(
ssize_t
)
openFileCount
;
while
(
position
>
0
&&
openFileList
[
--
position
]
!=
me
);
//Remove me from the list
openFileList
[
position
]
=
openFileList
[
--
openFileCount
];
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment