summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorFrederico Lamberti Pissarra <fredericopissarra@gmail.com>2016-05-09 00:26:38 -0300
committerFrederico Lamberti Pissarra <fredericopissarra@gmail.com>2016-05-09 00:26:38 -0300
commitacc53a9ac567a1596a000e8703398d891e4f3bc1 (patch)
treea17ba620c8db3981c610399da3b1a37abfec63c9 /src/main.c
parente2698bfae5680feebc81a371561b69c410473bcc (diff)
strncpy, snprintf and vsnprintf changed to strncpyz, snprintfz and vsnprintfz. And sometimes they are not necessary.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 760ab641d4..aebeee1b01 100644
--- a/src/main.c
+++ b/src/main.c
@@ -241,8 +241,7 @@ int main(int argc, char **argv)
else if(strcmp(argv[i], "-nodaemon") == 0 || strcmp(argv[i], "-nd") == 0) dont_fork = 1;
else if(strcmp(argv[i], "-pidfile") == 0 && (i+1) < argc) {
i++;
- strncpy(pidfile, argv[i], FILENAME_MAX);
- pidfile[FILENAME_MAX] = '\0';
+ strncpyz(pidfile, argv[i], FILENAME_MAX);
}
else if(strcmp(argv[i], "--unittest") == 0) {
rrd_update_every = 1;
@@ -403,8 +402,8 @@ int main(int argc, char **argv)
// let the plugins know the min update_every
{
- char buf[50];
- snprintf(buf, 50, "%d", rrd_update_every);
+ char buf[51];
+ snprintfz(buf, 50, "%d", rrd_update_every);
setenv("NETDATA_UPDATE_EVERY", buf, 1);
}