Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

awk: Fix clippy::manual_c_str_literals #316

Merged
merged 1 commit into from
Oct 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
awk: Fix clippy::manual_c_str_literals
  • Loading branch information
fox0 committed Oct 12, 2024
commit b201a2431c188983e07f6902cfdf0807d6ad06d0
4 changes: 2 additions & 2 deletions awk/src/interpreter/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ impl WritePipes {
Entry::Vacant(e) => {
let command: CString = command.try_into()?;
let file = unsafe {
let file = libc::popen(command.as_ptr(), "w\0".as_ptr() as *const i8);
let file = libc::popen(command.as_ptr(), c"w".as_ptr());
if file.is_null() {
return Err("failed to open pipe".to_string());
}
Expand Down Expand Up @@ -351,7 +351,7 @@ impl PipeRecordReader {
pub fn open(command: &str) -> Result<Self, String> {
let command = CString::new(command).map_err(|e| e.to_string())?;
let file = unsafe {
let file = libc::popen(command.as_ptr(), "r\0".as_ptr() as *const i8);
let file = libc::popen(command.as_ptr(), c"r".as_ptr());
if file.is_null() {
return Err("failed to open pipe".to_string());
}
Expand Down