mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-02 08:40:11 +01:00
Fix the termination of the readlink result
nread is the number of bytes put into the buffer, let's terminate it there
instead of one byte over. This only worked because execdir was initialized to
zero.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 34fe17f723)
This commit is contained in:
parent
66b2d85a5e
commit
dc1edd140f
1 changed files with 1 additions and 1 deletions
|
|
@ -50,7 +50,7 @@ builddir_lookup(void)
|
|||
|
||||
/* readlink doesn't terminate the string and readlink says
|
||||
anything past sz is undefined */
|
||||
execdir[++nread] = '\0';
|
||||
execdir[nread] = '\0';
|
||||
|
||||
pathsep = strrchr(execdir, '/');
|
||||
if (!pathsep)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue