Skip to content

Commit 73c90c4

Browse files
authored
Avoid implicit conversion from sexp to bool (#543)
1 parent 788df43 commit 73c90c4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/iconv_file.cc

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <cerrno>
2+
#include <cpp11/as.hpp>
23
#include <cpp11/R.hpp>
34

45
#include "R_ext/Riconv.h"
@@ -23,8 +24,8 @@
2324
size_t insize = 0;
2425
void* cd;
2526

26-
bool should_close_in = !isOpen(in_con);
27-
bool should_close_out = !isOpen(out_con);
27+
bool should_close_in = !cpp11::as_cpp<bool>(isOpen(in_con));
28+
bool should_close_out = !cpp11::as_cpp<bool>(isOpen(out_con));
2829

2930
if (should_close_in) {
3031
open(in_con, "rb");

0 commit comments

Comments
 (0)