It might have something to do with:
r_Val=ftell(dtl_Fp);
if ((ftell(dtl_Fp)==0)){break;}
You are calling ftell() twice, but never using r_val.
There is nothing in the code segment that allows me to see the value of sizeof(trans_Pass)*(x)
, the argument in fseek(), but if it is not a legal value (0, file size) it could result in unexpected result.
There is no guarantee that ftell()
is not returning a -1. You are not checking for that. Upon an error condition, ftell returns -1, then sets errno to a nonzero value which can be used to get information on the nature of the error.