Skip to content

Commit 5532eb1

Browse files
authored
Merge pull request #316 from fox0/clippy--manual_c_str_literals
awk: Fix clippy::manual_c_str_literals
2 parents 40d3be7 + b201a24 commit 5532eb1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

awk/src/interpreter/io.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ impl WritePipes {
286286
Entry::Vacant(e) => {
287287
let command: CString = command.try_into()?;
288288
let file = unsafe {
289-
let file = libc::popen(command.as_ptr(), "w\0".as_ptr() as *const i8);
289+
let file = libc::popen(command.as_ptr(), c"w".as_ptr());
290290
if file.is_null() {
291291
return Err("failed to open pipe".to_string());
292292
}
@@ -351,7 +351,7 @@ impl PipeRecordReader {
351351
pub fn open(command: &str) -> Result<Self, String> {
352352
let command = CString::new(command).map_err(|e| e.to_string())?;
353353
let file = unsafe {
354-
let file = libc::popen(command.as_ptr(), "r\0".as_ptr() as *const i8);
354+
let file = libc::popen(command.as_ptr(), c"r".as_ptr());
355355
if file.is_null() {
356356
return Err("failed to open pipe".to_string());
357357
}

0 commit comments

Comments
 (0)