MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / DatabaseWrite

Method DatabaseWrite

netgames/dmfc/dmfcbase.cpp:4314–4329  ·  view source on GitHub ↗

DatabaseWrite Writes/Updates a string to the database

Source from the content-addressed store, hash-verified

4312// DatabaseWrite
4313// Writes/Updates a string to the database
4314bool DMFCBase::DatabaseWrite(const char *label, const char *entry, int entrylen) {
4315 if (DatabaseRegisteredName[0] == '\0')
4316 return false;
4317 if (!label || !entry)
4318 return false;
4319
4320 int reg_len = strlen(DatabaseRegisteredName);
4321 int copy = MAX_DBLABEL_SIZE - 1 - reg_len;
4322 char buffer[MAX_DBLABEL_SIZE];
4323
4324 strcpy(buffer, DatabaseRegisteredName);
4325 strncpy(&buffer[reg_len], label, copy);
4326 buffer[MAX_DBLABEL_SIZE - 1] = '\0';
4327
4328 return DatabaseWrite(buffer, entry, entrylen);
4329}
4330
4331// DatabaseWrite
4332// Writes/Updates a value to the database

Calls 1

DatabaseWriteFunction · 0.85

Tested by

no test coverage detected