mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 00:37:23 +01:00
Chore: don't use strncpy in favor of strlcpy
strncpy doesn't require target to be NUL terminated
This commit is contained in:
@@ -460,8 +460,7 @@ static const char* detectPci(const FFGPUOptions* options, FFlist* gpus, FFstrbuf
|
||||
{
|
||||
if (ffStrStartsWith(entry->d_name, "card"))
|
||||
{
|
||||
strncpy(drmKeyBuffer, entry->d_name, sizeof(drmKeyBuffer) - 1);
|
||||
drmKeyBuffer[sizeof(drmKeyBuffer) - 1] = '\0';
|
||||
strlcpy(drmKeyBuffer, entry->d_name, sizeof(drmKeyBuffer));
|
||||
drmKey = drmKeyBuffer;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user