diff --git a/src/MeshTest/MeshTest.cxx b/src/MeshTest/MeshTest.cxx
index d02cfcd917..80f41a3ab1 100644
--- a/src/MeshTest/MeshTest.cxx
+++ b/src/MeshTest/MeshTest.cxx
@@ -39,6 +39,7 @@
 #include <IMeshData_Status.hxx>
 #include <Message.hxx>
 #include <Message_ProgressRange.hxx>
+#include <OSD_OpenFile.hxx>
 #include <Poly_Connect.hxx>
 #include <TopExp_Explorer.hxx>
 #include <TopTools_MapIteratorOfMapOfShape.hxx>
@@ -788,17 +789,17 @@ static Standard_Integer wavefront(Draw_Interpretor&, Standard_Integer nbarg, con
   Standard_Integer n1, n2, n3;
   Standard_Integer k1, k2, k3;
 
-  char ffile[100];
+  TCollection_AsciiString  aFile;
 
   if (nbarg == 3) {
-    strcpy(ffile, argv[2]);
-    strcat(ffile, ".obj");
+    aFile = argv[2];
+    aFile += ".obj";
   }
-  else  strcpy(ffile, "wave.obj");
-  FILE* outfile = fopen(ffile, "w");
+  else  aFile = "wave.obj";
+  FILE* outfile = OSD_OpenFile(aFile.ToCString(), "w");
 
 
-  fprintf(outfile, "%s  %s\n%s %s\n\n", "# CASCADE   ","MATRA DATAVISION", "#", ffile);
+  fprintf(outfile, "%s  %s\n%s %s\n\n", "# CASCADE   ","MATRA DATAVISION", "#", aFile.ToCString());
 
   Standard_Integer nbNodes, totalnodes = 0, nbpolygons = 0;
   for (ex.Init(S, TopAbs_FACE); ex.More(); ex.Next()) {
diff --git a/tests/demo/draw/bug31908 b/tests/demo/draw/bug31908
new file mode 100644
index 0000000000..217c5263ff
--- /dev/null
+++ b/tests/demo/draw/bug31908
@@ -0,0 +1,8 @@
+puts "=========="
+puts "0031908: Draw Harness, TKTopTest - wavefront file path length is limited to 100 characters"
+puts "=========="
+puts ""
+pload MODELING 
+box b 10 20 30
+wavefront b the_name_of_saved_with_wavefront_command_box_that_measures_10_20_30_and_has_length_of_its_name_longer_than_100_characters
+puts "TEST COMPLETED"