Skip to content

Commit

Permalink
fix #14 issue, add check stream invalid for bitstr_tell.
Browse files Browse the repository at this point in the history
  • Loading branch information
rockcarry committed Feb 24, 2020
1 parent 6042cc5 commit 5d07fff
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions bitstr.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ int bitstr_seek(void *stream, long offset, int origin)
long bitstr_tell(void *stream)
{
int type = *(int*)stream;
if (!stream) return EOF;
switch (type) {
case BITSTR_MEM : return mbitstr_tell(stream);
case BITSTR_FILE: return fbitstr_tell(stream);
Expand Down

0 comments on commit 5d07fff

Please sign in to comment.