@@ -293,8 +293,9 @@ SEXP rnng_tls_config(SEXP client, SEXP server, SEXP pass, SEXP auth) {
293
293
const char * crl , * file , * key , * pss ;
294
294
SEXP xp ;
295
295
296
- if ((usefile = Rf_xlength (client )) > 0 ) {
297
- file = NANO_STRING (client );
296
+ if (client != R_NilValue ) {
297
+ file = CHAR (STRING_ELT (client , 0 ));
298
+ usefile = XLENGTH (client );
298
299
if (usefile > 1 )
299
300
crl = NANO_STR_N (client , 1 );
300
301
if ((xc = nng_tls_config_alloc (& cfg , NNG_TLS_MODE_CLIENT )))
@@ -311,9 +312,10 @@ SEXP rnng_tls_config(SEXP client, SEXP server, SEXP pass, SEXP auth) {
311
312
goto exitlevel2 ;
312
313
}
313
314
314
- } else if ((usefile = Rf_xlength (server )) > 0 ) {
315
- file = NANO_STRING (server );
316
- pss = pass != R_NilValue ? NANO_STRING (pass ) : NULL ;
315
+ } else if (server != R_NilValue ) {
316
+ file = CHAR (STRING_ELT (server , 0 ));
317
+ usefile = XLENGTH (server );
318
+ pss = pass != R_NilValue ? CHAR (STRING_ELT (pass , 0 )) : NULL ;
317
319
if (usefile > 1 )
318
320
key = NANO_STR_N (server , 1 );
319
321
if ((xc = nng_tls_config_alloc (& cfg , NNG_TLS_MODE_SERVER )))
0 commit comments