move init of virtImage to init instead of init index
This commit is contained in:
2023-11-13 18:45:45 +01:00
parent 40bc58bdd9
commit c90a827dca

View File

@@ -244,9 +244,6 @@ void init_index(void) {
str_cat(virt_file[0].data, len, '\n');
root = root->next;
}
virt_file[2].data = malloc(100);
virt_file[2].len = 100;
}
struct tftp_context tftpContext_s = {.open = tftp_open, .close = tftp_close, .read = tftp_read, .write = tftp_write};
@@ -258,6 +255,9 @@ void tftp_server_init(void) {
LOG_INFO(TAG, "Initializing tftp server");
// init the index.txt virt_file
init_index();
// init the virtImage.raw virt_file
virt_file[2].data = malloc(81920 * sizeof(char));
virt_file[2].len = 81920;
// Init the tftp server
if (tftp_init(&tftpContext_s) != ERR_OK) {