The Standards says:
7.21.8.1 The fread function
If a partial element is read, its value is indeterminate.
The element in this case is of size 1024 bytes and you read one element.
The element, entire block of 1024 bytes, will have an indeterminate value. Reading that value could cause undefined behavior.
And:
The fread function returns the number of elements successfully read, which may be
less than nmemb if a read error or end-of-file is encountered.
If you get a return value of 0, then zero elements were successfully read, another indicator that the element wasn't read correctly, and should not be used, as mentioned before.