[PATCH] don't store temporary value returned from c_str()

David Bremner david at tethera.net
Sat Apr 27 04:53:33 PDT 2013


Vladimir Marek <Vladimir.Marek at Oracle.COM> writes:

>
> const char*
> string::c_str(void) {
> 	char buf[100];
>
> 	strcpy (buf, this->internal_representation);
> 	return buf;
> }

Isn't that undefined behavior, returning a pointer to a (non-static)
local variable?

d


More information about the notmuch mailing list