diff --git a/Source/ElektronischeLast.cpp b/Source/ElektronischeLast.cpp index def718d..e3c5ba7 100644 --- a/Source/ElektronischeLast.cpp +++ b/Source/ElektronischeLast.cpp @@ -94,11 +94,15 @@ int main (void) uint16_t set_solltrom(CLI_OutFunction pfvOutFunction, char *acCommands[], uint16_t u16ArgCount) { char buf[40]; - uint32_t in = strtoul(acCommands[0], NULL, 10); uint32_t cur = i_soll; - snprintf(buf, sizeof(buf), "\r\nAktueller Soll-Strom: %" PRIu32 ", Neu: %" PRIu32, cur, in); + int32_t pos = snprintf(buf, sizeof(buf), "\r\nAktueller Soll-Strom: %" PRIu32, cur); + if(u16ArgCount == 1U) + { + uint32_t in = strtoul(acCommands[0], NULL, 10); + snprintf(&buf[pos], sizeof(buf) - pos, " Neu: %" PRIu32, in); + i_soll = in; + } pfvOutFunction(buf); - i_soll = in; return 0; }