MCPcopy Create free account
hub / github.com/ddnet/ddnet / ValidIdentifier

Function ValidIdentifier

src/engine/client/serverbrowser.cpp:264–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264static bool ValidIdentifier(const char *pId, size_t MaxLength)
265{
266 if(pId[0] == '\0' || (size_t)str_length(pId) >= MaxLength)
267 {
268 return false;
269 }
270
271 for(int i = 0; pId[i] != '\0'; ++i)
272 {
273 if(pId[i] == '"' || pId[i] == '/' || pId[i] == '\\')
274 {
275 return false;
276 }
277 }
278 return true;
279}
280
281static bool ValidateIdentifier(const char *pId, size_t MaxLength, const char *pContext, IConsole *pConsole)
282{

Callers 1

ValidateIdentifierFunction · 0.85

Calls 1

str_lengthFunction · 0.85

Tested by

no test coverage detected