MCPcopy Create free account
hub / github.com/defold/defold / DecodeEscapedChar

Function DecodeEscapedChar

engine/dlib/src/dlib/mdns.cpp:266–289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264 }
265
266 static bool DecodeEscapedChar(const char** cursor, char* out)
267 {
268 if (**cursor != '\\')
269 {
270 *out = **cursor;
271 ++(*cursor);
272 return true;
273 }
274
275 ++(*cursor);
276 if (**cursor == 0)
277 return false;
278
279 if (IsDigit((*cursor)[0]) && IsDigit((*cursor)[1]) && IsDigit((*cursor)[2]))
280 {
281 *out = (char) ((((*cursor)[0] - '0') * 100) + (((*cursor)[1] - '0') * 10) + ((*cursor)[2] - '0'));
282 *cursor += 3;
283 return true;
284 }
285
286 *out = **cursor;
287 ++(*cursor);
288 return true;
289 }
290
291 static void EscapeDnsText(const char* value, char* out, uint32_t out_size)
292 {

Callers 2

UnescapeDnsTextFunction · 0.70
WriteNameFunction · 0.70

Calls 1

IsDigitFunction · 0.70

Tested by

no test coverage detected