common: Fix line break handling, finding a space.

* common/name-value.c (assert_raw_value): Correctly find a space.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2019-08-06 13:14:58 +09:00
parent d8a49bbcd1
commit f588dd8d17
1 changed files with 3 additions and 3 deletions

View File

@ -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;