Change MAXLENGTH from int to long

1) ftell returns long int but in original code it casted to int
2) changed default_l function