引用: C/C++ セキュアコーディング 第2版 by Robert C. Seacordら
動的メモリ割り当て関数 ISO/IEC TR 24731-2 [ISO/IEC TR 24731-2:2010]は、strncpy()の代替関数として使用可能な関数として、strndup()関数を定義している。
[SO](http://stackoverflow.com/questions/6062822/whats-wrong-with-strndup)
string.hにstrdnup()が見つからないよ、という質問。理由は以下のようだ。
by Mat
strndup is "standard", but that standard is not implemented widely (yet). It's been present in GLIBC as an extension for quite a while. (But +1 anyway, malloc + strcpy is a good workaround.)