Open Loris1123 opened 2 years ago
@Loris1123 - Yes, that will work, although arguably better for readability to use if(logfp != NULL) {
2018 POSIX spec for fopen says: "Upon successful completion, fopen() shall return a pointer to the object controlling the stream. Otherwise, a null pointer shall be returned, and errno shall be set to indicate the error."
Looks like that was also the behavior of fopen
in POSIX.1-2001. Not sure what changed since this code was released, but this is a good fix that should be mainlined.
I got the following build error when building UDSim on my Arch Linux:
To fix the issue I changed the corrensponding line to
Keep in mind I'm not a C programmer and don't know if that is the way, this issue should be fixed. But for me it works :-)