This isn't really a sensible way to use strncpy -- in fact, I'm pretty sure that this is buggy and should be S.size() + 1, otherwise we're not copying the trailing null byte, which is important in this context.
Explicitly specifying the length does make sense (as we already know it here), but in that case we should just use memcpy, or, to make it more idiomatic for C++, std::copy.
Generated assembly for strcpy is smaller than that for std::copy, but there is 2 calls in std::copy and 3 calls in strcpy. Could not evaluate performance by just looking at assemblies.
LGTM. Assuming you don't have commit access, can you tell me the Name <email> to use for the commit?