MCPcopy Create free account
hub / github.com/SmingHub/Sming / pbufStrCopy

Function pbufStrCopy

Sming/Components/Network/src/Network/NetUtils.cpp:118–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118String pbufStrCopy(const pbuf* buf, unsigned startPos, unsigned length)
119{
120 char* stringPtr = new char[length + 1];
121 if(stringPtr == nullptr) {
122 return nullptr;
123 }
124 stringPtr[length] = '\0';
125 pbuf_copy_partial(const_cast<pbuf*>(buf), stringPtr, length, startPos);
126 String res = String(stringPtr);
127 delete[] stringPtr;
128 return res;
129}
130
131#ifdef FIX_NETWORK_ROUTING
132bool FixNetworkRouting()

Callers 1

onReceiveMethod · 0.85

Calls 1

StringClass · 0.70

Tested by

no test coverage detected