From f8bd8b97bea9273d166efdc06c3a6a54fc24ffdb Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 13 Aug 2017 16:48:27 -0400 Subject: command: Don't pass max_size to command_encodef() The command_encodef() can read the max_size parameter directly from the 'struct command_encoder' passed into it. Also, there is no need to check that a message will fit in a buffer if the buffer is declared to be MESSAGE_MAX in size. Signed-off-by: Kevin O'Connor --- src/command.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/command.h') diff --git a/src/command.h b/src/command.h index 91d7cd80..e493c3ee 100644 --- a/src/command.h +++ b/src/command.h @@ -63,8 +63,8 @@ enum { // command.c char *command_parsef(char *p, char *maxend , const struct command_parser *cp, uint32_t *args); -uint8_t command_encodef(char *buf, uint8_t buf_len - , const struct command_encoder *ce, va_list args); +uint8_t command_encodef(char *buf, const struct command_encoder *ce + , va_list args); void command_sendf(const struct command_encoder *ce, ...); void command_add_frame(char *buf, uint8_t msglen); int8_t command_find_block(char *buf, uint8_t buf_len, uint8_t *pop_count); -- cgit v1.2.3-70-g09d2