A colleage of me just wrote innocent looking code like
char *shardRelationName = pnstrdup(relationName, NAMEDATALEN);
which is at the moment wrong if relationName isn't preallocated to
* Like pstrdup(), but append null byte to a
* not-necessarily-null-terminated input string.
pnstrdup(const char *in, Size len)
char *out = palloc(len + 1);
memcpy(out, in, len);
out[len] = '\0';
isn't that a somewhat weird behaviour / implementation? Not really like
strndup(), which one might believe to be analoguous...
Sent via pgsql-hackers mailing list (firstname.lastname@example.org)
To make changes to your subscription: