Skip to content

Commit ab972a7

Browse files
committed
Fixed linting
1 parent 52f1596 commit ab972a7

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Diff for: src/flamegpu/io/Telemetry.cpp

+5-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include <windows.h>
1919
#include <shlobj.h>
2020
#else
21-
#include <cstdlib>
2221
#include <sys/types.h>
2322
#include <pwd.h>
2423
#endif
@@ -170,7 +169,7 @@ std::string Telemetry::generateData(std::string event_name, std::map<std::string
170169
// check ENV for test variable FLAMEGPU_TEST_ENVIRONMENT
171170
std::string testmode = isTestMode() ? "true" : "false";
172171
std::string appID = TELEMETRY_APP_ID;
173-
std::string telemetryRandomID = Telemetry::getUserId(); // Obtain a unique user ID
172+
std::string telemetryRandomID = Telemetry::getUserId(); // Obtain a unique user ID
174173

175174
// Differentiate pyflamegpu in the payload via the SWIG compiler macro, which we only define when building for pyflamegpu.
176175
// A user could potentially static link against a build using that macro, but that's not a use-case we are currently concerned with.
@@ -320,7 +319,7 @@ std::string Telemetry::getConfigDirectory() {
320319
return std::string(home) + "/.config";
321320
}
322321
else {
323-
struct passwd* pwd = getpwuid(getuid());
322+
struct passwd* pwd = getpwuid_r(getuid());
324323
if (pwd) {
325324
return std::string(pwd->pw_dir) + "/.config";
326325
}
@@ -354,16 +353,16 @@ std::string Telemetry::getUserId() {
354353
try {
355354
// Determine config file location
356355
std::string configDir = Telemetry::getConfigDirectory() + "/FLAMEGPU";
357-
std::filesystem::create_directories(configDir); // Ensure the directory exists
356+
std::filesystem::create_directories(configDir); // Ensure the directory exists
358357
std::string filePath = configDir + "/flamegpu_user.cfg";
359358

360359
// Check if the file exists
361360
if (std::filesystem::exists(filePath)) {
362361
std::ifstream file(filePath);
363362
if (file.is_open()) {
364-
std::getline(file, userId); // overwrite existing Id
363+
std::getline(file, userId); // overwrite existing Id
365364
file.close();
366-
return userId; // Config file and user id found so return it
365+
return userId; // Config file and user id found so return it
367366
}
368367
else {
369368
throw std::runtime_error("Unable to open user ID file for reading");

0 commit comments

Comments
 (0)