MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / ReadString

Function ReadString

src/Protocol.c:162–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162static void ReadString(cc_uint8** ptr, cc_string* str) {
163 int i, length = 0;
164 cc_uint8* data = *ptr;
165 for (i = STRING_SIZE - 1; i >= 0; i--) {
166 char code = data[i];
167 if (code == '\0' || code == ' ') continue;
168 length = i + 1; break;
169 }
170
171 String_AppendAll(str, data, length);
172 *ptr = data + STRING_SIZE;
173}
174
175static void WriteString(cc_uint8* data, const cc_string* value) {
176 int i, count = min(value->length, STRING_SIZE);

Callers 3

Classic_HandshakeFunction · 0.85
Classic_AddEntityFunction · 0.85
Classic_MessageFunction · 0.85

Calls 1

String_AppendAllFunction · 0.85

Tested by

no test coverage detected