mirror of
https://github.com/nginx/nginx.git
synced 2024-12-15 13:28:59 +08:00
22 lines
297 B
C
22 lines
297 B
C
|
|
||
|
#include <ngx_config.h>
|
||
|
#include <ngx_string.h>
|
||
|
|
||
|
|
||
|
char *ngx_cpystrn(char *dst, char *src, size_t n)
|
||
|
{
|
||
|
if (n == 0)
|
||
|
return dst;
|
||
|
|
||
|
for (/* void */; --n; dst++, src++) {
|
||
|
*dst = *src;
|
||
|
|
||
|
if (*dst == '\0')
|
||
|
return dst;
|
||
|
}
|
||
|
|
||
|
*dst = '\0';
|
||
|
|
||
|
return dst;
|
||
|
}
|