calling fwrite() with a null pointer causes undefined behavior. avoid it.
This commit is contained in:
@ -562,7 +562,8 @@ void DumpAtom::write_binary(int n, double *mybuf)
|
||||
|
||||
void DumpAtom::write_string(int n, double *mybuf)
|
||||
{
|
||||
fwrite(mybuf,sizeof(char),n,fp);
|
||||
if (mybuf)
|
||||
fwrite(mybuf,sizeof(char),n,fp);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
Reference in New Issue
Block a user