common: Fix line break handling, finding a space.
authorNIIBE Yutaka <gniibe@fsij.org>
Tue, 6 Aug 2019 04:14:58 +0000 (13:14 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Tue, 6 Aug 2019 04:14:58 +0000 (13:14 +0900)
* common/name-value.c (assert_raw_value): Correctly find a space.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
common/name-value.c

index 989a5b1..f663ecf 100644 (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;