Skip to content

Commit 8943afc

Browse files
author
Phil Carns
committed
write trailing null byte in mnt table
- this should make the log format slightly more robust with respect to how the data is decompressed, but does not require any file format change
1 parent 4eb4a3a commit 8943afc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

darshan-runtime/lib/darshan-core.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1701,8 +1701,12 @@ static int darshan_log_open(char *logfile_name, struct darshan_core_runtime *cor
17011701
static int darshan_log_write_job_record(darshan_core_log_fh log_fh,
17021702
struct darshan_core_runtime *core, uint64_t *inout_off)
17031703
{
1704+
/* prepare to write two contiguous elements in file: the job structure
1705+
* and a trailing string that contains the command line and mount table
1706+
* information. Include a trailing null byte in the latter.
1707+
*/
17041708
void *pointers[2] = {core->log_job_p, core->log_exemnt_p};
1705-
int lengths[2] = {sizeof(struct darshan_job), strlen(core->log_exemnt_p)};
1709+
int lengths[2] = {sizeof(struct darshan_job), strlen(core->log_exemnt_p)+1};
17061710
int comp_buf_sz = core->config.mod_mem;
17071711
int ret;
17081712

0 commit comments

Comments
 (0)