diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index ccbe30267b..c759003d3b 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -989,4 +989,20 @@ function generate_random_mac() { return $mac; } +/****f* pfsense-utils/strncpy + * NAME + * strncpy - copy strings + * INPUTS + * &$dst, $src, $length + * RESULT + * none + ******/ +function strncpy(&$dst, $src, $length) { + if (strlen($src) > $length) { + $dst = substr($src, 0, $length); + } else { + $dst = $src; + } +} + ?>