Skip to content

Commit b9ecc1d

Browse files
committed
In dtc_compile, use c string instead of stl string
1 parent d9f21fc commit b9ecc1d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

riscv/dts.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ std::string make_dts(size_t insns_per_rtc_tick, size_t cpu_hz,
101101

102102
static std::string dtc_compile(const std::string& dtc_input, bool compile)
103103
{
104-
const std::string input_type = compile ? "dts" : "dtb";
105-
const std::string output_type = compile ? "dtb" : "dts";
104+
const char* input_type = compile ? "dts" : "dtb";
105+
const char* output_type = compile ? "dtb" : "dts";
106106

107107
int dtc_input_pipe[2];
108108
pid_t dtc_input_pid;
@@ -144,7 +144,7 @@ static std::string dtc_compile(const std::string& dtc_input, bool compile)
144144
close(dtc_input_pipe[1]);
145145
close(dtc_output_pipe[0]);
146146
close(dtc_output_pipe[1]);
147-
execlp(DTC, DTC, "-O", output_type.c_str(), "-I", input_type.c_str(), (char *)0);
147+
execlp(DTC, DTC, "-O", output_type, "-I", input_type, nullptr);
148148
std::cerr << "Failed to run " DTC ": " << strerror(errno) << std::endl;
149149
exit(1);
150150
}

0 commit comments

Comments
 (0)