The fgetc/ungetc calls then set/clear eof flag indefinitely.
{
"filters" :
[
{ "id" : "inAnyErrorReadGroup",
"tag" : "RG:ERR*"
},
{ "id" : "highMapQuality",
"mapQuality" : ">=75"
},
{ "id" : "bothMatesMapped",
"isMapped" : "true",
"isMateMapped" : "true"
}
],
"rule" : "!inAnyErrorReadGroup & (highMapQuality | bothMatesMapped)"
}