projects
/
platform
/
upstream
/
libinput.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
024162e
)
Fix the termination of the readlink result
author
Peter Hutterer
<peter.hutterer@who-t.net>
Tue, 10 Nov 2020 04:25:31 +0000
(14:25 +1000)
committer
Peter Hutterer
<peter.hutterer@who-t.net>
Tue, 10 Nov 2020 04:27:22 +0000
(14:27 +1000)
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>
src/builddir.h
patch
|
blob
|
history
diff --git
a/src/builddir.h
b/src/builddir.h
index bc0c9e5473da2929e3399e9674c1f52629fc4ab5..19825759a5193aebb6d694a6bb05103ac1865bd3 100644
(file)
--- a/
src/builddir.h
+++ b/
src/builddir.h
@@
-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)