Skip to content

Commit c28416f

Browse files
author
shanedsnyder
authored
Merge pull request #1003 from darshan-hpc/carns/trailing-byte-mnt-table
write trailing null byte in mnt table
2 parents 3fbd266 + 8943afc commit c28416f

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)