Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • openfoam openfoam
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 415
    • Issues 415
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 7
    • Merge requests 7
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • openfoamopenfoam
  • Issues
  • #132
Closed
Open
Issue created May 30, 2016 by Admin@OpenFOAM-adminMaintainer

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

Assignee
Assign to
Time tracking