diff options
| author | Vito Caputo <vcaputo@pengaru.com> | 2022-02-06 18:26:20 -0800 | 
|---|---|---|
| committer | Vito Caputo <vcaputo@pengaru.com> | 2022-02-06 18:26:20 -0800 | 
| commit | f908c1e73a81baec74c1a2d312078dabd398bd06 (patch) | |
| tree | c50c8520052dca72bba2522ff1051e839b9596ba /src/vmon.c | |
| parent | 3006963740924fb4eff32fb513fc3306c926ead7 (diff) | |
vmon: suppress "(null)" name in snapshot filenames
When this code changed to use a local, potentially heap-allocated
name variable, it started producing "(null)" when no -n/--name
was supplied, that wasn't intended.
Just use a "" name when NULL, enabling bare date-derived snapshot
filenames.  This seems preferable since even if you supplied an
empty -n/--name you'd get a hyphen at the start of the name.  I
can see scenarios where you have unnamed files labeled by the
output dir instead.
Diffstat (limited to 'src/vmon.c')
| -rw-r--r-- | src/vmon.c | 2 | 
1 files changed, 1 insertions, 1 deletions
| @@ -752,7 +752,7 @@ static int vmon_snapshot(vmon_t *vmon)  	strftime(start_str, sizeof(start_str), "%m.%d.%y-%T", start_time);  	snprintf(path, sizeof(path), "%s/%s%s%s-%u.png",  		vmon->output_dir, -		name, +		name ? name : "",  		name ? "-" : "",  		start_str,  		vmon->n_snapshots++); | 
