From e6158e300d3134e44f741e01108dd088297c476f Mon Sep 17 00:00:00 2001 From: "Ali H. Fardan" Date: Mon, 12 Sep 2016 13:51:43 +0300 Subject: subtraction is unneeded --- slstatus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'slstatus.c') diff --git a/slstatus.c b/slstatus.c index e38b963..70d8fbb 100644 --- a/slstatus.c +++ b/slstatus.c @@ -260,7 +260,7 @@ hostname(void) fgets(hostname, sizeof(hostname), fp); /* FIXME: needs improvement */ - memset(&hostname[strlen(hostname)-1], '\0', + memset(&hostname[strlen(hostname)], '\0', sizeof(hostname) - strlen(hostname)); fclose(fp); -- cgit v1.2.3