From jeroen.ooms at stat.ucla.edu  Tue May 24 17:42:01 2016
From: jeroen.ooms at stat.ucla.edu (Jeroen Ooms)
Date: Tue, 24 May 2016 17:42:01 +0200
Subject: [Rd] Suggestion: mkString(NULL) should be NA
In-Reply-To: <CABFfbXt7raZDRaGP+T=XWKeBZq8oh88FRh8+Xj7jFkf_VFspsA@mail.gmail.com>
References: <CABFfbXt7raZDRaGP+T=XWKeBZq8oh88FRh8+Xj7jFkf_VFspsA@mail.gmail.com>
Message-ID: <CABFfbXu0LTrSy9Qq5mouq6fX=nN=NF9xshtM8Q9khYn3cWtEQw@mail.gmail.com>

On Thu, May 12, 2016 at 1:20 PM, Jeroen Ooms <jeroen.ooms at stat.ucla.edu> wrote:
> I would like to propose that Rf_mkString(NULL) and Rf_mkChar(NULL)
> return NA rather than segfault.

An example implementation: https://git.io/vroxm

With this patch, mkChar(NULL), mkCharCE(NULL, ce) would return
NA_STRING rather than segfault at strlen(NULL). This automatically
fixes mkString(NULL) as well which wraps mkChar (See Rinlinedfuns.h).



[Rd] Suggestion: mkString(NULL) should be NA
Jeroen Ooms