truncate boot_out.txt if it's long
Now this boot.py: ```py for i in range(1000): print(i) ``` creates a 512-byte boot_out.txt that ends ``` 88 89 ... ```
This commit is contained in:
parent
694af3dd23
commit
efffb62b36
@ -60,7 +60,13 @@ void mp_hal_stdout_tx_strn(const char *str, size_t len) {
|
||||
|
||||
#ifdef CIRCUITPY_BOOT_OUTPUT_FILE
|
||||
if (boot_output != NULL) {
|
||||
vstr_add_strn(boot_output, str, len);
|
||||
// Ensure boot_out.txt is capped at 1 filesystem block and ends with a newline
|
||||
if (len + boot_output->len > 508) {
|
||||
vstr_add_str(boot_output, "...\n");
|
||||
boot_output = NULL;
|
||||
} else {
|
||||
vstr_add_strn(boot_output, str, len);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user