comparison src/core/ngx_string.c @ 0:4eff17414a43

nginx-0.0.1-2002-08-06-20:39:45 import The first code that uses "ngx_" prefix, the previous one used "gx_" prefix. At that point the code is not yet usable. The first draft ideas are dated back to 23.10.2001.
author Igor Sysoev <igor@sysoev.ru>
date Tue, 06 Aug 2002 16:39:45 +0000
parents
children e43f406e4525
comparison
equal deleted inserted replaced
-1:000000000000 0:4eff17414a43
1
2 #include <ngx_config.h>
3 #include <ngx_string.h>
4
5
6 char *ngx_cpystrn(char *dst, char *src, size_t n)
7 {
8 if (n == 0)
9 return dst;
10
11 for (/* void */; --n; dst++, src++) {
12 *dst = *src;
13
14 if (*dst == '\0')
15 return dst;
16 }
17
18 *dst = '\0';
19
20 return dst;
21 }