projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
drop direct use of stat syscalls in internal __map_file
[musl]
/
src
/
unistd
/
gethostname.c
diff --git
a/src/unistd/gethostname.c
b/src/unistd/gethostname.c
index
f984b7d
..
633ef57
100644
(file)
--- a/
src/unistd/gethostname.c
+++ b/
src/unistd/gethostname.c
@@
-8,6
+8,6
@@
int gethostname(char *name, size_t len)
if (uname(&uts)) return -1;
if (len > sizeof uts.nodename) len = sizeof uts.nodename;
for (i=0; i<len && (name[i] = uts.nodename[i]); i++);
- if (i==len) name[i-1] = 0;
+ if (i
&& i
==len) name[i-1] = 0;
return 0;
}