From 13cbb19adc79e567b122feecbc03eb8ff8a93054 Mon Sep 17 00:00:00 2001 From: sin Date: Fri, 14 Feb 2014 15:11:06 +0000 Subject: [PATCH] Fix wrong length for sethostname() This was messed up in the previous commit. --- hostname.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hostname.c b/hostname.c index 4d068c8..7b9177a 100644 --- a/hostname.c +++ b/hostname.c @@ -36,7 +36,7 @@ main(int argc, char *argv[]) eprintf("gethostname:"); puts(host); } else { - if (sethostname(argv[0], sz + 1) < 0) + if (sethostname(argv[0], strlen(argv[0])) < 0) eprintf("sethostname:"); }