MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / write_string

Function write_string

sql-common/client.c:2450–2462  ·  view source on GitHub ↗

Write 1 byte of string length header information to dest and copy src_len bytes from src to dest. */

Source from the content-addressed store, hash-verified

2448 copy src_len bytes from src to dest.
2449*/
2450char *write_string(char *dest, char *dest_end, char *src, char *src_end)
2451{
2452 size_t src_len= (size_t)(src_end - src);
2453 uchar *to= NULL;
2454 if (src_len >= 251)
2455 return NULL;
2456 *dest=(uchar) src_len;
2457 to= (uchar*) dest+1;
2458 if ((char*)(to + src_len) >= dest_end)
2459 return NULL;
2460 memcpy(to, src, src_len);
2461 return (char*)(to + src_len);
2462}
2463/**
2464 sends a COM_CHANGE_USER command with a caller provided payload
2465

Callers 1

send_client_reply_packetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected