Skip to content

Commit

Permalink
Fix setting level 10 or more
Browse files Browse the repository at this point in the history
  • Loading branch information
cielavenir committed Apr 29, 2024
1 parent ff0e515 commit c5d493a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bgzf_compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ int bgzf_compress(void *_dst, size_t *_dlen, const void *src, size_t slen, int l
//fputs(smethod,stderr);fputs("\n",stderr);
//set level
int _level=-1;
int digit=1;
int l=strlen(smethod);
int i=l-1;
for(;i>=0 && '0'<=smethod[i]&&smethod[i]<='9';i--){
if(_level<0)_level=0;
_level*=10;
_level+=smethod[i]-'0';
_level+=digit*(smethod[i]-'0');
digit*=10;
}
if(_level>=0)level=_level;
//set method
Expand Down

0 comments on commit c5d493a

Please sign in to comment.