From: Waldemar Kozaczuk <jwkozac...@gmail.com>
Committer: Nadav Har'El <n...@scylladb.com>
Branch: master

Improved procfs hostname implementation

Improved procfs hostname implementation to address code review
 suggestions.

Signed-off-by: Waldemar Kozaczuk <jwkozac...@gmail.com>
Message-Id: <1517030246-8062-1-git-send-email-jwkozac...@gmail.com>

---
diff --git a/fs/procfs/procfs_vnops.cc b/fs/procfs/procfs_vnops.cc
--- a/fs/procfs/procfs_vnops.cc
+++ b/fs/procfs/procfs_vnops.cc
@@ -354,10 +354,8 @@ static std::string procfs_mounts()

 static std::string procfs_hostname()
 {
-    char hostname[4096];
-    memset(hostname, 0, 4096);
-
-    int ret = gethostname(hostname, 4095);
+    char hostname[65];
+    int ret = gethostname(hostname, 65);
     if (ret < 0) {
         return std::string("");
     }

--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to