aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2014-04-15 13:23:49 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2014-04-15 13:23:49 -0700
commit06e395cd75dc79289ae789c146795189c32babd8 (patch)
tree190e1f8741d57b040ea5ee7c38bfde6deef6208b
parent1ba3e80738407d13bc4a71812578848b6f657e23 (diff)
downloadklibc-06e395cd75dc79289ae789c146795189c32babd8.tar.gz
readlink: Reduce size by calling _fwrite() instead of puts()
We know how long the output is, so we might as well call _fwrite() directly, with the explicit termination set to \n instead of \0. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--usr/utils/readlink.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr/utils/readlink.c b/usr/utils/readlink.c
index bf9501b2672dd..4e3cfcbc0ee5a 100644
--- a/usr/utils/readlink.c
+++ b/usr/utils/readlink.c
@@ -29,8 +29,8 @@ int main(int argc, char *argv[])
perror(name);
exit(1);
}
- link_name[rv] = '\0';
- puts(link_name);
+ link_name[rv] = '\n';
+ _fwrite(link_name, rv+1, stdout);
}
return 0;