change add_logininfo_to_buffer

to accept size of data for future use
This commit is contained in:
Nikola Petrov
2024-07-21 23:43:52 +02:00
parent 6bfe732b7c
commit 8b60cdc81b
3 changed files with 8 additions and 8 deletions

View File

@@ -48,11 +48,11 @@ void delete_logininfo_from_buffer(Buffer &buffer, int index_of_pass)
in_index->offset -= sizeof(LoginInfo);
}
void add_logininfo_to_buffer(Buffer &buffer, const char *label, const char *username, const char *password)
void add_logininfo_to_buffer(Buffer &buffer, const char *label, size_t label_size, const char *username, size_t username_size, const char *password, size_t password_size)
{
uint32_t label_start = buffer.add_end((uint8_t *)label, strlen(label) + 1);
uint32_t username_start = buffer.add_end((uint8_t *)username, strlen(username) + 1);
uint32_t password_start = buffer.add_end((uint8_t *)password, strlen(password) + 1);
uint32_t label_start = buffer.add_end((uint8_t *)label, label_size + 1);
uint32_t username_start = buffer.add_end((uint8_t *)username, username_size + 1);
uint32_t password_start = buffer.add_end((uint8_t *)password, password_size + 1);
Index *index = (Index *)buffer.buffer;