diff options
author | Tanu Kaskinen <tanu.kaskinen@linux.intel.com> | 2014-05-24 12:01:12 +0300 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-05-25 11:21:19 +0800 |
commit | 5216f599ff677a18016bfa1995d1f1e6a50e4a0b (patch) | |
tree | b189cc19b72aac514a380ee8b48f867e98bfbd38 /man/machine-info.xml | |
parent | 590b6b9188e75ba46c42995984a1c2fa06adb6d6 (diff) |
path-util: fix missing terminating zero
There was this code:
if (to_path_len > 0)
memcpy(p, to_path, to_path_len);
That didn't add the terminating zero, so the resulting string was
corrupt if this code path was taken.
Using strcpy() instead of memcpy() solves this issue, and also
simplifies the code.
Previously there was special handling for shortening "../../" to
"../..", but that has now been replaced by a path_kill_slashes() call,
which also makes the result prettier in case the input contains
redundant slashes that would otherwise be copied to the result.
Diffstat (limited to 'man/machine-info.xml')
0 files changed, 0 insertions, 0 deletions