Squirrel

The programming language
Welcome to Squirrel Sign in | Join | Help
in Search

Loading scripts from an archive

Last post 01-09-2010, 12:35 AM by skreamz. 2 replies.
Sort Posts: Previous Next
  •  01-06-2010, 8:52 PM 3604

    Loading scripts from an archive

    hi all, im using Sqrat and irrlicht, and im trying to use irrlicht's file IO for reading in a script then passing it to Sqrat's script loading functions, now the problem im getting is, (testing with scripts outside of and archive) if i load the script with Sqrats functions, i have no problem whats so ever, then loading with irrlichts functions (btw they only read in binary so im loading into a char array) i get the script with no problem, but i somehow end up with additional info at the end of the script that is not there. e.g.

    my script would load but have the following at the end

    £^^%$


    or some other nonsense.

    any help would be grateful.
  •  01-07-2010, 10:41 AM 3605 in reply to 3604

    Re: Loading scripts from an archive

    The first thing in my mind is that there is a problem with the null termination of the char array... That would at least explain the random stuff at the end.

    Check the length of the array vs return value from the strlen function.

    Good luck.
  •  01-09-2010, 12:35 AM 3606 in reply to 3605

    Re: Loading scripts from an archive

    thanks, that was it. funny how the simplest things are always the hardest to find.
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems