foamToEnsight crash when patch name > 80 char
in OpenFOAM2.2.1 when using foamToEnsight binary output, if the patch name is equal or greater then 80 characters, it crashes. The crash can be avoided by doing the following modification:
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightBinaryStream.H
@@ -98,7 +98,7 @@ public:
virtual void write(const char* val)
{
char buffer[80] = {0};
- strcpy(buffer, val);
+ strncpy(buffer, val, 80);
str_().write(buffer, 80*sizeof(char));
}
The same crash happens with OpenFOAM-v3.0+. Would it be possible to use the above modification to fix ensightBinaryStream.H?
Thank you