summaryrefslogtreecommitdiff
path: root/Lib/r/rfragments.swg
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2011-03-29 20:14:59 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2011-03-29 20:14:59 +0000
commite2fcd71e0c4773e458ea30059c0f968115c24594 (patch)
tree33ce2d352642c0c8f979e7332a05a1b5dcb1866d /Lib/r/rfragments.swg
parent24d695a7a1ca507c85ddc8e8e7cb338dc7eb4edc (diff)
downloadswig-e2fcd71e0c4773e458ea30059c0f968115c24594.tar.gz
Apply patch #3239076 from Marie White fixing strings for R >= 2.7.0
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12565 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Lib/r/rfragments.swg')
-rw-r--r--Lib/r/rfragments.swg6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/r/rfragments.swg b/Lib/r/rfragments.swg
index 8a0d85580..afb75c3c1 100644
--- a/Lib/r/rfragments.swg
+++ b/Lib/r/rfragments.swg
@@ -170,12 +170,12 @@ SWIG_FromCharPtrAndSize(const char* carray, size_t size)
order to allow for use of CHARSXP caches. */
Rf_protect(t = Rf_allocVector(STRSXP, 1));
-#if R_VERSION >= R_Version(2,7,0)
+%#if R_VERSION >= R_Version(2,7,0)
c = Rf_mkCharLen(carray, size);
-#else
+%#else
c = Rf_allocVector(CHARSXP, size);
strncpy((char *)CHAR(c), carray, size);
-#endif
+%#endif
SET_STRING_ELT(t, 0, c);
Rf_unprotect(1);
return t;