COMP: replace sprintf with snprintf (MacOS), add note about vfork

This commit is contained in:
Alexey Matveichev
2023-06-14 10:07:35 +02:00
committed by Mark Olesen
parent ffbd05f72a
commit 83b1ebee6f
3 changed files with 10 additions and 8 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2016-2022 OpenCFD Ltd.
Copyright (C) 2016-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -234,7 +234,7 @@ void Foam::fileFormats::STLCore::writeBinaryHeader
{
// STL header with extra information about nTris
char header[STLHeaderSize];
sprintf(header, "STL binary file %u facets", nTris);
::snprintf(header, STLHeaderSize, "STL binary file %u facets", nTris);
// Fill trailing with zeroes (to avoid writing junk)
for (size_t i = strlen(header); i < STLHeaderSize; ++i)