fread
will not null terminate the buffer passed to it, you are seeing extra characters as the data in date_capture
is not null terminated, you should call memset
to set date_capture
to all zeros prior to passing it to fread
1
solved fread gets more chars than i ask in c while working with binary file [duplicate]