]> git.mxchange.org Git - flightgear.git/commitdiff
Don't try to strlen() the input buffer if the length is zero. That
authorandy <andy>
Tue, 26 Apr 2005 17:18:00 +0000 (17:18 +0000)
committerandy <andy>
Tue, 26 Apr 2005 17:18:00 +0000 (17:18 +0000)
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

index 6163a30b92d66c930a42fef8b0506ed33b0b6114..ccb1e926a9d95e4d1b3764f9ade45efa5b78d22e 100644 (file)
@@ -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;