From f588dd8d1766de48c90a5501cf2d537f256d003e Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Tue, 6 Aug 2019 13:14:58 +0900 Subject: common: Fix line break handling, finding a space. * common/name-value.c (assert_raw_value): Correctly find a space. Signed-off-by: NIIBE Yutaka --- common/name-value.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/name-value.c b/common/name-value.c index 989a5b111..f663ecfe1 100644 --- a/common/name-value.c +++ b/common/name-value.c @@ -195,11 +195,11 @@ assert_raw_value (nve_t entry) size_t i; /* Find a suitable space to break on. */ - for (i = linelen - 1; linelen - i < 30 && linelen - i > offset; i--) - if (ascii_isspace (entry->value[i])) + for (i = linelen - 1; linelen - i < 30; i--) + if (ascii_isspace (entry->value[offset+i])) break; - if (ascii_isspace (entry->value[i])) + if (ascii_isspace (entry->value[offset+i])) { /* Found one. */ amount = i; -- cgit v1.2.3