summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2019-08-06 06:14:58 +0200
committerNIIBE Yutaka <gniibe@fsij.org>2019-08-06 06:14:58 +0200
commitf588dd8d1766de48c90a5501cf2d537f256d003e (patch)
treeb8c3dc882525f5cca7fb61cfd24175c8d644ea98 /common
parentgpg: Don't report NO_SECKEY for valid key. (diff)
downloadgnupg2-f588dd8d1766de48c90a5501cf2d537f256d003e.tar.xz
gnupg2-f588dd8d1766de48c90a5501cf2d537f256d003e.zip
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>
Diffstat (limited to 'common')
-rw-r--r--common/name-value.c6
1 files changed, 3 insertions, 3 deletions
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;