host_config touch-ups

Change-Id: I3f891191eb3a4cbeb70f6f6f6ed926c1f18c0171
diff --git a/host/libs/config/host_config.cpp b/host/libs/config/host_config.cpp
index 14acdd8..df39bb6 100644
--- a/host/libs/config/host_config.cpp
+++ b/host/libs/config/host_config.cpp
@@ -16,16 +16,15 @@
 
 #include "host/libs/config/host_config.h"
 
-#include <stdlib.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstring>
 #include <string>
 #include <iomanip>
 #include <sstream>
 
 #include <gflags/gflags.h>
 
-const char kVsocUserPrefix[] = "vsoc-";
-const char kDefaultUuidPrefix[] = "699acfc4-c8c4-11e7-882b-5065f31dc1";
+constexpr char kDefaultUuidPrefix[] = "699acfc4-c8c4-11e7-882b-5065f31dc1";
 
 DEFINE_string(domain, vsoc::GetDefaultShmClientSocketPath(),
               "Path to the ivshmem client socket");
@@ -35,9 +34,11 @@
               "UUID to use for the device. Random if not specified");
 
 int vsoc::GetDefaultInstance() {
-  char* user = getenv("USER");
-  if (user && !memcmp(user, kVsocUserPrefix, sizeof(kVsocUserPrefix) - 1)) {
-    int temp = atoi(user + sizeof(kVsocUserPrefix) - 1);
+  static constexpr char kVsocUserPrefix[] = "vsoc-";
+  const char* user = std::getenv("USER");
+  if (user && !std::strncmp(user, kVsocUserPrefix,
+                            sizeof(kVsocUserPrefix) - 1)) {
+    int temp = std::atoi(user + sizeof(kVsocUserPrefix) - 1);
     if (temp > 0) {
       return temp;
     }