@@ -168,8 +168,8 @@ SEXP rnng_ncurl(SEXP http, SEXP convert, SEXP follow, SEXP method, SEXP headers,
168
168
if (TYPEOF (hnames ) == STRSXP && XLENGTH (hnames ) == hlen ) {
169
169
for (R_xlen_t i = 0 ; i < hlen ; i ++ ) {
170
170
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 ))))
173
173
goto exitlevel4 ;
174
174
}
175
175
}
@@ -262,7 +262,7 @@ SEXP rnng_ncurl(SEXP http, SEXP convert, SEXP follow, SEXP method, SEXP headers,
262
262
SET_VECTOR_ELT (out , 1 , rvec );
263
263
Rf_namesgets (rvec , response );
264
264
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 ));
266
266
SET_VECTOR_ELT (rvec , i , r == NULL ? R_NilValue : Rf_mkString (r ));
267
267
}
268
268
} else {
@@ -343,8 +343,8 @@ SEXP rnng_ncurl_aio(SEXP http, SEXP convert, SEXP method, SEXP headers, SEXP dat
343
343
if (TYPEOF (hnames ) == STRSXP && XLENGTH (hnames ) == hlen ) {
344
344
for (R_xlen_t i = 0 ; i < hlen ; i ++ ) {
345
345
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 ))))
348
348
goto exitlevel4 ;
349
349
}
350
350
}
@@ -476,7 +476,7 @@ static SEXP rnng_aio_http_impl(SEXP env, const int typ) {
476
476
PROTECT (rvec = Rf_allocVector (VECSXP , rlen ));
477
477
Rf_namesgets (rvec , response );
478
478
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 ));
480
480
SET_VECTOR_ELT (rvec , i , r == NULL ? R_NilValue : Rf_mkString (r ));
481
481
}
482
482
UNPROTECT (1 );
@@ -557,8 +557,8 @@ SEXP rnng_ncurl_session(SEXP http, SEXP convert, SEXP method, SEXP headers, SEXP
557
557
if (TYPEOF (hnames ) == STRSXP && XLENGTH (hnames ) == hlen ) {
558
558
for (R_xlen_t i = 0 ; i < hlen ; i ++ ) {
559
559
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 ))))
562
562
goto exitlevel4 ;
563
563
}
564
564
}
@@ -670,7 +670,7 @@ SEXP rnng_ncurl_transact(SEXP session) {
670
670
SET_VECTOR_ELT (out , 1 , rvec );
671
671
Rf_namesgets (rvec , response );
672
672
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 ));
674
674
SET_VECTOR_ELT (rvec , i , r == NULL ? R_NilValue : Rf_mkString (r ));
675
675
}
676
676
} else {
0 commit comments