The SDK example "datalayer.register.node" contains the following code: (line breaks added by me)
auto bfbsPath = getenv("SNAP") != nullptr
? strcat(getenv("SNAP"), "/sampleSchema.bfbs")
This seems incorrect to me: strcat() modifies the buffer pointed to by its first argument, but the man page for getenv() states:
... getenv() returns a pointer to a string within the environment list. The caller must take care not to modify this string ...
Instead, I think the sample code should do something like:
const char * snapPath = getenv("SNAP");
strcpy(bfbsPath, (snapPath == nullptr) ? "bfbs" : snapPath);
Of course, it would be even better to replace strcpy/strcat with functions that check the destination buffer size.