Add Fix argument processing of influxDB URL in nfprofile. Issue #99

This commit is contained in:
Peter Haag 2018-04-01 12:37:32 +02:00
parent 325aea7cae
commit 0082088cf2
2 changed files with 9 additions and 3 deletions

View File

@ -2,6 +2,7 @@
- Add program exit in nfx.c after panic with correupt data file - Add program exit in nfx.c after panic with correupt data file
- Add missing size check when reading nfdump 1.5.x common record blocks - Add missing size check when reading nfdump 1.5.x common record blocks
- Add missing option -M in man page. Issue #103 - Add missing option -M in man page. Issue #103
- Add Fix processing of influx URL in nfprofile
2018-02-11 2018-02-11
- Add missing json output format in nfdump help text - Add missing json output format in nfdump help text

View File

@ -544,7 +544,7 @@ time_t tslot;
// default file names // default file names
ffile = "filter.txt"; ffile = "filter.txt";
rfile = NULL; rfile = NULL;
while ((c = getopt(argc, argv, "D:HIL:p:P:hif:J;r:n:M:S:t:VzZ")) != EOF) { while ((c = getopt(argc, argv, "D:HIL:p:P:hi:f:J;r:n:M:S:t:VzZ")) != EOF) {
switch (c) { switch (c) {
case 'h': case 'h':
usage(argv[0]); usage(argv[0]);
@ -613,8 +613,13 @@ time_t tslot;
compress = LZO_COMPRESSED; compress = LZO_COMPRESSED;
break; break;
#ifdef HAVE_INFLUXDB #ifdef HAVE_INFLUXDB
case 'i': case 'i':
strncpy(influxdb_url, optarg, 1024); if ( optarg != NULL )
strncpy(influxdb_url, optarg, 1024);
else {
LogError("Missing argument for -i <influx URL>\n");
exit(255);
}
influxdb_url[1023] = '\0'; influxdb_url[1023] = '\0';
break; break;
#endif #endif