summaryrefslogtreecommitdiffstats
path: root/src/procfile.c
diff options
context:
space:
mode:
authorLennart Weller <lhw@ring0.de>2016-05-25 10:36:24 +0000
committerLennart Weller <lhw@ring0.de>2016-05-25 10:36:24 +0000
commitb4f64f72a3e4bf590c60b0cbd6cd365aa1a58542 (patch)
treee6706c727a1fedb44da614453ad3e429a7403a9b /src/procfile.c
parentImported Upstream version 1.1.0 (diff)
downloadnetdata-b4f64f72a3e4bf590c60b0cbd6cd365aa1a58542.tar.xz
netdata-b4f64f72a3e4bf590c60b0cbd6cd365aa1a58542.zip
Imported Upstream version 1.2.0upstream/1.2.0
Diffstat (limited to 'src/procfile.c')
-rw-r--r--src/procfile.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/procfile.c b/src/procfile.c
index 1fc33ef5f..291f14519 100644
--- a/src/procfile.c
+++ b/src/procfile.c
@@ -445,8 +445,7 @@ procfile *procfile_open(const char *filename, const char *separators, uint32_t f
return NULL;
}
- strncpy(ff->filename, filename, FILENAME_MAX);
- ff->filename[FILENAME_MAX] = '\0';
+ strncpyz(ff->filename, filename, FILENAME_MAX);
ff->fd = fd;
ff->size = size;
@@ -479,8 +478,7 @@ procfile *procfile_reopen(procfile *ff, const char *filename, const char *separa
return NULL;
}
- strncpy(ff->filename, filename, FILENAME_MAX);
- ff->filename[FILENAME_MAX] = '\0';
+ strncpyz(ff->filename, filename, FILENAME_MAX);
ff->flags = flags;