Revert "Fixed a bug which caused printing of floats larger than 100 in the CLI to crash"
This reverts commit 6ce8fe3c0f
.
This commit is contained in:
parent
e1f52d9c7b
commit
3dd6424f34
|
@ -144,11 +144,6 @@ char *itoa(int i, char *a, int base)
|
|||
|
||||
#endif
|
||||
|
||||
/* Note: the floatString must be at least 13 bytes long to cover all cases.
|
||||
* This includes up to 10 digits (32 bit ints can hold numbers up to 10
|
||||
* digits long) + the decimal point + negative sign or space + null
|
||||
* terminator.
|
||||
*/
|
||||
char *ftoa(float x, char *floatString)
|
||||
{
|
||||
int32_t value;
|
||||
|
|
|
@ -21,17 +21,7 @@ void li2a(long num, char *bf);
|
|||
void ui2a(unsigned int num, unsigned int base, int uc, char *bf);
|
||||
void i2a(int num, char *bf);
|
||||
char a2i(char ch, const char **src, int base, int *nump);
|
||||
|
||||
/* Simple conversion of a float to a string. Will display completely
|
||||
* inaccurate results for floats larger than about 2.15E6 (2^31 / 1000)
|
||||
* (same thing for negative values < -2.15E6).
|
||||
* Will always display 3 decimals, so anything smaller than 1E-3 will
|
||||
* not be displayed.
|
||||
* The floatString will be filled in with the result and will be
|
||||
* returned. It must be at least 13 bytes in length to cover all cases!
|
||||
*/
|
||||
char *ftoa(float x, char *floatString);
|
||||
|
||||
float fastA2F(const char *p);
|
||||
|
||||
#ifndef HAVE_ITOA_FUNCTION
|
||||
|
|
|
@ -2448,7 +2448,7 @@ static void cliWrite(uint8_t ch)
|
|||
static void cliPrintVar(const clivalue_t *var, uint32_t full)
|
||||
{
|
||||
int32_t value = 0;
|
||||
char buf[13];
|
||||
char buf[8];
|
||||
|
||||
void *ptr = var->ptr;
|
||||
if ((var->type & VALUE_SECTION_MASK) == PROFILE_VALUE) {
|
||||
|
|
Loading…
Reference in New Issue