diff --git a/src/linux/get_user_count.cpp b/src/linux/get_user_count.cpp
index c942ee4a544135f570e399723c5461ee23090bc7..c7eb324c409fb5173d21bfb4b42706362d194ffc 100644
--- a/src/linux/get_user_count.cpp
+++ b/src/linux/get_user_count.cpp
@@ -204,7 +204,8 @@ static struct user_log * last_modified() {
     /*
      *    Which file do we want to read?
      */
-    ufile = (char *)(WTMP_FILE);
+    char *auxar = WTMP_FILE;
+    ufile = auxar;
     time(&lastdown);
 
     /*
@@ -481,11 +482,12 @@ int get_user_count() {
 
     std::string wtmp_path = "/var/log/wtmp";
     struct stat buffer;
-    if (stat(wtmp_path.c_str(), &buffer) != 0) { //file not exists
+    if (stat(wtmp_path.c_str(), &buffer) != 0) {  // file not exists
         ofstream wtmp_file;
         wtmp_file.open(wtmp_path.c_str());
         wtmp_file.close();
-        chown(wtmp_path.c_str(), getpwnam("root")->pw_uid, getgrnam("tty")->gr_gid);
+        chown(wtmp_path.c_str(), getpwnam("root")->pw_uid,
+                                 getgrnam("tty")->gr_gid);
         chmod(wtmp_path.c_str(), 664);
     }
 
diff --git a/src/linux/inventory.cpp b/src/linux/inventory.cpp
index 88e11663eba3da8deece39b7c8697adc77b8b01c..ff41037b0034f5b82d2c1ab089d90d15548d8a7e 100644
--- a/src/linux/inventory.cpp
+++ b/src/linux/inventory.cpp
@@ -65,7 +65,8 @@ Json::Value get_inventory() {
     inv["contact_date"] =
     */
 
-    if (inv["data"]["os_distro"].asString().find("Linux Comunicações") != std::string::npos) {
+    if (inv["data"]["os_distro"].asString().find("Linux Comunicações")
+                                                != std::string::npos) {
         try {
             inv["data"]["machine_type"] = get_machine_type();
         }
diff --git a/src/windows/get_macaddr.cpp b/src/windows/get_macaddr.cpp
index 83454c8263118b302388681eadc9e28b1c854831..d5bf70f36463b364f4a15555e5e8b5356ec80e2d 100644
--- a/src/windows/get_macaddr.cpp
+++ b/src/windows/get_macaddr.cpp
@@ -24,9 +24,10 @@
 string get_macaddr() {
     PIP_ADAPTER_INFO AdapterInfo;
     DWORD dwBufLen = sizeof(AdapterInfo);
-    char *mac_addr = (char*)malloc(17);
+    char *mac_addr = reinterpret_cast<char*>malloc(17);
 
-    AdapterInfo = (IP_ADAPTER_INFO *) malloc(sizeof(IP_ADAPTER_INFO));
+    AdapterInfo = (reinterpret_cast<char*>IP_ADAPTER_INFO *)
+                             malloc(sizeof(IP_ADAPTER_INFO));
     if (AdapterInfo == NULL) {
         printf("Error allocating memory needed to call GetAdaptersinfo\n");
     }
@@ -35,7 +36,8 @@ string get_macaddr() {
     // the dwBufLen variable
     if (GetAdaptersInfo(AdapterInfo, &dwBufLen) == ERROR_BUFFER_OVERFLOW) {
 
-        AdapterInfo = (IP_ADAPTER_INFO *) malloc(dwBufLen);
+        AdapterInfo = (reinterpret_cast<char*>IP_ADAPTER_INFO *)
+                                                malloc(dwBufLen);
         if (AdapterInfo == NULL) {
             printf("Error allocating memory needed to call GetAdaptersinfo\n");
         }
@@ -46,7 +48,7 @@ string get_macaddr() {
         // Contains pointer to current adapter info
         PIP_ADAPTER_INFO pAdapterInfo = AdapterInfo;
 
-        sprintf(mac_addr, "%02X:%02X:%02X:%02X:%02X:%02X",
+        snprintf(mac_addr, "%02X:%02X:%02X:%02X:%02X:%02X",
         pAdapterInfo->Address[0], pAdapterInfo->Address[1],
         pAdapterInfo->Address[2], pAdapterInfo->Address[3],
         pAdapterInfo->Address[4], pAdapterInfo->Address[5]);
diff --git a/src/windows/get_time.cpp b/src/windows/get_time.cpp
index 4bef83fa213fdd0f1dbcdf754f4a6a6aa4ac05f2..85410a9706ad22fed9d46d228f53f13290591dbe 100644
--- a/src/windows/get_time.cpp
+++ b/src/windows/get_time.cpp
@@ -30,7 +30,7 @@ std::string get_time() {
     char buffer[20];
 
     time(&rawtime);
-    timeinfo = localtime(&rawtime);
+    timeinfo = localtime_r(&rawtime, timeinfo);
 
     // HH:MM:SS
     strftime(buffer, 20, "%H:%M:%S", timeinfo);