]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Remove last usages of the legacy format function
authorJoel Rosdahl <joel@rosdahl.net>
Tue, 28 Jul 2020 11:58:31 +0000 (13:58 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 28 Jul 2020 12:12:36 +0000 (14:12 +0200)
src/legacy_util.cpp
src/stats.cpp

index dad04155fb1d656a51b7957e3b65a68d7b33afdd..e3dce08149eefd2129931b93dc8de328e6e707ed 100644 (file)
@@ -127,7 +127,9 @@ x_setenv(const char* name, const char* value)
 #ifdef HAVE_SETENV
   setenv(name, value, true);
 #else
-  putenv(format("%s=%s", name, value)); // Leak to environment.
+  char* string;
+  asprintf(&string, "%s=%s", name, value);
+  putenv(string);       // Leak to environment.
 #endif
 }
 
@@ -138,7 +140,7 @@ x_unsetenv(const char* name)
 #ifdef HAVE_UNSETENV
   unsetenv(name);
 #else
-  putenv(strdup(name));                 // Leak to environment.
+  putenv(strdup(name)); // Leak to environment.
 #endif
 }
 
index 06cca020dd58147afa9d67e1e08437ed338f8419..b4ee6c40c56f8ab7ce2e882c8ba61d4f0468f36c 100644 (file)
@@ -196,7 +196,7 @@ format_timestamp(uint64_t timestamp)
     localtime_r(reinterpret_cast<time_t*>(&timestamp), &tm);
     char buffer[100];
     strftime(buffer, sizeof(buffer), "%c", &tm);
-    return format("    %s", buffer);
+    return std::string("    ") + buffer;
   } else {
     return {};
   }