Ticket #3698: fix mcedit codejump (etags filenames parsing)

This got broken in the following commit for mc-4.8.16:

    a5ebb7d6199ae41cb71743bd2a2f4197b973dad6

As `g_strlcpy` got replaced with `g_strndup`, the meaning of the last
argument has changed: it is no longer the destination size in bytes, but
the maximum number of bytes to copy, and so it had to be decremented by
one accordingly, hence the bug.

Signed-off-by: Roman Mikhayloff <rimf@inbox.ru>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
This commit is contained in:
Roman Mikhayloff 2016-10-08 11:15:22 +02:00 committed by Yury V. Zaytsev
parent 2c576fad94
commit 224f53518e

View File

@ -214,7 +214,7 @@ etags_set_definition_hash (const char *tagfile, const char *start_path,
pos = strcspn (buf, ",");
g_free (filename);
filename = g_strndup (buf, pos + 1);
filename = g_strndup (buf, pos);
state = in_define;
break;
}