projects
/
suckless
/
slstatus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6edc959
)
improved hostname()
author
Ali H. Fardan
<raiz@firemail.cc>
Wed, 14 Sep 2016 09:22:03 +0000
(12:22 +0300)
committer
Ali H. Fardan
<raiz@firemail.cc>
Wed, 14 Sep 2016 09:22:03 +0000
(12:22 +0300)
slstatus.c
patch
|
blob
|
history
diff --git
a/slstatus.c
b/slstatus.c
index 572f9641db3f132c359209d5b8877d31fa88f08e..fefdf6f70168a3f86ec9462cb7790be0b6ad0ecf 100644
(file)
--- a/
slstatus.c
+++ b/
slstatus.c
@@
-272,9
+272,7
@@
hostname(void)
}
fgets(hostname, sizeof(hostname), fp);
- /* FIXME: needs improvement */
- memset(&hostname[strlen(hostname)-1], '\0',
- sizeof(hostname) - strlen(hostname));
+ hostname[strlen(hostname)-1] = '\0';
fclose(fp);
return smprintf("%s", hostname);