Skip to content

Commit

Permalink
Avoid implicit conversion from sexp to bool (#543)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavisVaughan authored Aug 23, 2024
1 parent 788df43 commit 73c90c4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/iconv_file.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <cerrno>
#include <cpp11/as.hpp>
#include <cpp11/R.hpp>

#include "R_ext/Riconv.h"
Expand All @@ -23,8 +24,8 @@
size_t insize = 0;
void* cd;

bool should_close_in = !isOpen(in_con);
bool should_close_out = !isOpen(out_con);
bool should_close_in = !cpp11::as_cpp<bool>(isOpen(in_con));
bool should_close_out = !cpp11::as_cpp<bool>(isOpen(out_con));

if (should_close_in) {
open(in_con, "rb");
Expand Down

0 comments on commit 73c90c4

Please sign in to comment.