diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-11-18 16:26:01 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-11-18 16:26:01 +0100 |
commit | 28b24f2286a8fdea2670cfacbdd252a697dbb10f (patch) | |
tree | b8d7051f9d7d487a87a5543c5af33d306b96b602 /user/tlecarrour | |
parent | e3333982b0899c40d34c93dca7b767b190c97fae (diff) |
Fix setting the NUL caracter
Diffstat (limited to 'user/tlecarrour')
-rw-r--r-- | user/tlecarrour/porting_guide_for_dummies.mdwn | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/user/tlecarrour/porting_guide_for_dummies.mdwn b/user/tlecarrour/porting_guide_for_dummies.mdwn index f43119bd..772be2bb 100644 --- a/user/tlecarrour/porting_guide_for_dummies.mdwn +++ b/user/tlecarrour/porting_guide_for_dummies.mdwn @@ -199,7 +199,7 @@ Call readlink(), check return value and set the null char in the linkname: len = readlink(filename, linkname, sb.st_size + 1); if (len < 0 || len > sb.st_size) { ... - linkname[sb.st_size] = '\0'; + linkname[len] = '\0'; ### Alternative use of readlink(): readlink_malloc() |