generics fix with fprintf fscanf