diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index 8992c3984..0434d8bce 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -1061,7 +1061,7 @@ public: if (tagstring.IsNotEmpty()) { FScanner sc; - sc.OpenMem("tagstring", tagstring.GetChars(), tagstring.Len()); + sc.OpenString("tagstring", tagstring); // scan the string as long as valid numbers can be found while (sc.CheckNumber()) { @@ -1536,7 +1536,7 @@ public: if (tagstring.IsNotEmpty()) { FScanner sc; - sc.OpenMem("tagstring", tagstring.GetChars(), tagstring.Len()); + sc.OpenString("tagstring", tagstring); // scan the string as long as valid numbers can be found while (sc.CheckNumber()) { diff --git a/src/sc_man.cpp b/src/sc_man.cpp index 4b9d710a3..9babe2e9c 100644 --- a/src/sc_man.cpp +++ b/src/sc_man.cpp @@ -195,9 +195,22 @@ void FScanner::OpenFile (const char *name) //========================================================================== void FScanner::OpenMem (const char *name, const char *buffer, int size) +{ + OpenString(name, FString(buffer, size)); +} + +//========================================================================== +// +// FScanner :: OpenString +// +// Like OpenMem, but takes a string directly. +// +//========================================================================== + +void FScanner::OpenString (const char *name, FString buffer) { Close (); - ScriptBuffer = FString(buffer, size); + ScriptBuffer = buffer; ScriptName = name; LumpNum = -1; PrepareScript (); diff --git a/src/sc_man.h b/src/sc_man.h index 3d9c2bec9..ba84cd00c 100644 --- a/src/sc_man.h +++ b/src/sc_man.h @@ -21,6 +21,7 @@ public: void Open(const char *lumpname); void OpenFile(const char *filename); void OpenMem(const char *name, const char *buffer, int size); + void OpenString(const char *name, FString buffer); void OpenLumpNum(int lump); void Close();