mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-25 11:46:31 +00:00
Berry input()
returns empty string and does not crash (#21565)
This commit is contained in:
parent
89b4376e31
commit
9e168d84d7
@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file.
|
|||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
- Berry `input()` returns empty string and does not crash
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
|
@ -216,7 +216,10 @@ extern "C" {
|
|||||||
|
|
||||||
BERRY_API char* be_readstring(char *buffer, size_t size)
|
BERRY_API char* be_readstring(char *buffer, size_t size)
|
||||||
{
|
{
|
||||||
return be_fgets(stdin, buffer, (int)size);
|
if ((size > 0) && (buffer != NULL)) {
|
||||||
|
*buffer = 0;
|
||||||
|
}
|
||||||
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* use the standard library implementation file API. */
|
/* use the standard library implementation file API. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user