@@ -168,8 +168,8 @@ SEXP rnng_ncurl(SEXP http, SEXP convert, SEXP follow, SEXP method, SEXP headers,
168168 if (TYPEOF (hnames ) == STRSXP && XLENGTH (hnames ) == hlen ) {
169169 for (R_xlen_t i = 0 ; i < hlen ; i ++ ) {
170170 if ((xc = nng_http_req_set_header (req ,
171- CHAR ( STRING_ELT ( hnames , i ) ),
172- CHAR ( STRING_ELT ( headers , i ) ))))
171+ NANO_STR_N ( hnames , i ),
172+ NANO_STR_N ( headers , i ))))
173173 goto exitlevel4 ;
174174 }
175175 }
@@ -262,7 +262,7 @@ SEXP rnng_ncurl(SEXP http, SEXP convert, SEXP follow, SEXP method, SEXP headers,
262262 SET_VECTOR_ELT (out , 1 , rvec );
263263 Rf_namesgets (rvec , response );
264264 for (R_xlen_t i = 0 ; i < rlen ; i ++ ) {
265- const char * r = nng_http_res_get_header (res , CHAR ( STRING_ELT ( response , i ) ));
265+ const char * r = nng_http_res_get_header (res , NANO_STR_N ( response , i ));
266266 SET_VECTOR_ELT (rvec , i , r == NULL ? R_NilValue : Rf_mkString (r ));
267267 }
268268 } else {
@@ -343,8 +343,8 @@ SEXP rnng_ncurl_aio(SEXP http, SEXP convert, SEXP method, SEXP headers, SEXP dat
343343 if (TYPEOF (hnames ) == STRSXP && XLENGTH (hnames ) == hlen ) {
344344 for (R_xlen_t i = 0 ; i < hlen ; i ++ ) {
345345 if ((xc = nng_http_req_set_header (handle -> req ,
346- CHAR ( STRING_ELT ( hnames , i ) ),
347- CHAR ( STRING_ELT ( headers , i ) ))))
346+ NANO_STR_N ( hnames , i ),
347+ NANO_STR_N ( headers , i ))))
348348 goto exitlevel4 ;
349349 }
350350 }
@@ -476,7 +476,7 @@ static SEXP rnng_aio_http_impl(SEXP env, const int typ) {
476476 PROTECT (rvec = Rf_allocVector (VECSXP , rlen ));
477477 Rf_namesgets (rvec , response );
478478 for (R_xlen_t i = 0 ; i < rlen ; i ++ ) {
479- const char * r = nng_http_res_get_header (handle -> res , CHAR ( STRING_ELT ( response , i ) ));
479+ const char * r = nng_http_res_get_header (handle -> res , NANO_STR_N ( response , i ));
480480 SET_VECTOR_ELT (rvec , i , r == NULL ? R_NilValue : Rf_mkString (r ));
481481 }
482482 UNPROTECT (1 );
@@ -557,8 +557,8 @@ SEXP rnng_ncurl_session(SEXP http, SEXP convert, SEXP method, SEXP headers, SEXP
557557 if (TYPEOF (hnames ) == STRSXP && XLENGTH (hnames ) == hlen ) {
558558 for (R_xlen_t i = 0 ; i < hlen ; i ++ ) {
559559 if ((xc = nng_http_req_set_header (handle -> req ,
560- CHAR ( STRING_ELT ( hnames , i ) ),
561- CHAR ( STRING_ELT ( headers , i ) ))))
560+ NANO_STR_N ( hnames , i ),
561+ NANO_STR_N ( headers , i ))))
562562 goto exitlevel4 ;
563563 }
564564 }
@@ -670,7 +670,7 @@ SEXP rnng_ncurl_transact(SEXP session) {
670670 SET_VECTOR_ELT (out , 1 , rvec );
671671 Rf_namesgets (rvec , response );
672672 for (R_xlen_t i = 0 ; i < rlen ; i ++ ) {
673- const char * r = nng_http_res_get_header (handle -> res , CHAR ( STRING_ELT ( response , i ) ));
673+ const char * r = nng_http_res_get_header (handle -> res , NANO_STR_N ( response , i ));
674674 SET_VECTOR_ELT (rvec , i , r == NULL ? R_NilValue : Rf_mkString (r ));
675675 }
676676 } else {
0 commit comments