|
@@ -23,7 +23,7 @@ void evil_portal_read_index_html(void* context) {
|
|
|
File* index_html = storage_file_alloc(storage);
|
|
File* index_html = storage_file_alloc(storage);
|
|
|
if(storage_file_open(
|
|
if(storage_file_open(
|
|
|
index_html, EVIL_PORTAL_INDEX_SAVE_PATH, FSAM_READ, FSOM_OPEN_EXISTING)) {
|
|
index_html, EVIL_PORTAL_INDEX_SAVE_PATH, FSAM_READ, FSOM_OPEN_EXISTING)) {
|
|
|
- app->index_html = malloc((size_t)fi.size);
|
|
|
|
|
|
|
+ app->index_html = malloc((size_t)fi.size + 1);
|
|
|
uint8_t* buf_ptr = app->index_html;
|
|
uint8_t* buf_ptr = app->index_html;
|
|
|
size_t read = 0;
|
|
size_t read = 0;
|
|
|
while(read < fi.size) {
|
|
while(read < fi.size) {
|
|
@@ -33,6 +33,8 @@ void evil_portal_read_index_html(void* context) {
|
|
|
read += now_read;
|
|
read += now_read;
|
|
|
buf_ptr += now_read;
|
|
buf_ptr += now_read;
|
|
|
}
|
|
}
|
|
|
|
|
+ *buf_ptr = '\0';
|
|
|
|
|
+ buf_ptr++;
|
|
|
free(buf_ptr);
|
|
free(buf_ptr);
|
|
|
}
|
|
}
|
|
|
storage_file_close(index_html);
|
|
storage_file_close(index_html);
|