From a701cc9309ad10cdd3550c86255463838f88577c Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 6 Jun 2015 17:14:25 -0700 Subject: [PATCH] EON Steel: empty descriptor lines are ok Suunto's new v1.1.15 firmware ends up terminating some final descriptor lines with a newline, rather than just using newlines as separators. So the last newline may not be followed by further data, but simple be the end of the string. Accept that case. Signed-off-by: Linus Torvalds --- src/suunto_eonsteel_parser.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/suunto_eonsteel_parser.c b/src/suunto_eonsteel_parser.c index aa10e12..2998bdb 100644 --- a/src/suunto_eonsteel_parser.c +++ b/src/suunto_eonsteel_parser.c @@ -79,6 +79,8 @@ static int record_type(suunto_eonsteel_parser_t *eon, unsigned short type, const next++; } else { len = strlen(name); + if (!len) + break; } if (len < 5 || name[0] != '<' || name[4] != '>') {