When compiling this under Windows Subsystem for Linux (WSL) using Ubuntu, I was able to get this to compile using the following steps:
diff --git a/nqc/DirList.cpp b/nqc/DirList.cpp
index 766b2b4..6bccc93 100644
--- a/nqc/DirList.cpp
+++ b/nqc/DirList.cpp
@@ -53,7 +53,7 @@ bool DirList::Find(const char *filename, char *pathname)
struct stat stat_buf;
size_t len = sizeof(pathname);
- if (strlcpy(pathname, filename, len) >= len) {
+ if (sizeof(strncpy(pathname, filename, len)) >= len) {
return false;
}
@@ -61,8 +61,8 @@ bool DirList::Find(const char *filename, char *pathname)
return true;
for(Entry *e = fEntries.GetHead(); e; e=e->GetNext()) {
- if (strlcpy(pathname, e->GetPath(), len) < len) {
- if (strlcat(pathname, filename, len) < len) {
+ if (sizeof(strncpy(pathname, e->GetPath(), len)) < len) {
+ if (sizeof(strncat(pathname, filename, len)) < len) {
if (stat(pathname, &stat_buf) == 0) {
return true;
}
If this sounds acceptable, I'll open a PR for the change.