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
34fe17f72353b5fe65724390e4ec384ec848499a)
/* 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)