MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / NormalizeString

Function NormalizeString

engine/Poseidon/UI/Map/UIMapExtDisplay.cpp:1004–1029  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1002 out.write("\r\n", 2);
1003}
1004
1005static RString NormalizeString(const char* src)
1006{
1007 static const int len = 1024;
1008 char dst[len];
1009 int i = 0;
1010 for (const char* ptr = src; *ptr; ptr++)
1011 {
1012 if (i >= len - 1)
1013 {
1014 Fail("Buffer overflow");
1015 break;
1016 }
1017 dst[i++] = *ptr;
1018 if (*ptr == '"')
1019 {
1020 if (i >= len - 1)
1021 {
1022 Fail("Buffer overflow");
1023 break;
1024 }
1025 dst[i++] = *ptr;
1026 }
1027 }
1028 dst[i] = 0;
1029 return dst;
1030}
1031
1032static RString ExtractValue(RString name, const EditorParams& params, const Arguments& args, bool& required)

Callers 1

ExtractValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected