gkeyfile: Fix off-by-one error in calculating value length

This was harmless, as it was always +1 too long, so included the
trailing nul terminator. However, upcoming changes will start to use it
in a context where there is no nul terminator.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
Philip Withnall 2021-03-14 15:39:38 +00:00
parent 535653eec1
commit b07408fe5d

View File

@ -1396,7 +1396,7 @@ g_key_file_parse_key_value_pair (GKeyFile *key_file,
while (g_ascii_isspace (*value_start))
value_start++;
value_len = line + length - value_start + 1;
value_len = line + length - value_start;
value = g_strndup (value_start, value_len);