From 239077599c02bf1aa9d1db2e9364ab8421098b51 Mon Sep 17 00:00:00 2001 From: andy <andy> Date: Tue, 26 Apr 2005 17:18:00 +0000 Subject: [PATCH] Don't try to strlen() the input buffer if the length is zero. That was probably my idea of a feature, but if the input buffer actually does has a length of zero (as Melchior discovered for the case of a zero-length .nas file) then there will be no null. --- src/Scripting/NasalSys.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Scripting/NasalSys.cxx b/src/Scripting/NasalSys.cxx index 6163a30b9..ccb1e926a 100644 --- a/src/Scripting/NasalSys.cxx +++ b/src/Scripting/NasalSys.cxx @@ -431,8 +431,6 @@ void FGNasalSys::readScriptFile(SGPath file, const char* module) void FGNasalSys::initModule(const char* moduleName, const char* fileName, const char* src, int len) { - if(len == 0) len = strlen(src); - naRef code = parse(fileName, src, len); if(naIsNil(code)) return;