Skip to content

Commit 1b69bf8

Browse files
authored
Merge pull request #45 from oneapi-src/sam/code_update/2402
[SeisAcoMod2D]zero-init the char arrays in struct Job
2 parents a64a6b8 + bfa4213 commit 1b69bf8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

SeisAcoMod2D/common/modelling.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <iostream>
1515
#include <map>
1616
#include <string>
17+
#include <cstring>
1718
#include <chrono>
1819

1920
#define TIMER_START() time_start = std::chrono::steady_clock::now();
@@ -68,6 +69,14 @@ typedef struct Job
6869
int adj, geomflag, fdop, frsf;
6970
char jbtype[8], shotfile[224], geomfile[224], logfile[224];
7071
char jobname[256], tmppath[512];
72+
Job() {
73+
memset(jbtype, 0, 8);
74+
memset(shotfile, 0, 224);
75+
memset(geomfile, 0, 224);
76+
memset(logfile, 0, 224);
77+
memset(jobname, 0, 256);
78+
memset(tmppath, 0, 512);
79+
}
7180
}job_t;
7281

7382
typedef struct Workload

0 commit comments

Comments
 (0)