Sign in
nest-open-source
/
nest-learning-thermostat
/
5.0
/
util-linux-ng
/
3848152627d350905d73127b1683a65478fac29f
/
.
/
util-linux-ng-2.17.2
/
include
/
xstrncpy.h
blob: 7ed4109d6710f3b6b014ff5d008904aa3825849d [
file
] [
log
] [
blame
]
/* NUL-terminated version of strncpy() */
#include
<string.h>
/* caller guarantees n > 0 */
static
inline
void
xstrncpy
(
char
*
dest
,
const
char
*
src
,
size_t
n
)
{
strncpy
(
dest
,
src
,
n
-
1
);
dest
[
n
-
1
]
=
0
;
}