source: bootcd/isolinux/syslinux-6.03/com32/lib/strlcpy.c

Last change on this file was e16e8f2, checked in by Edwin Eefting <edwin@datux.nl>, 3 years ago

bootstuff

  • Property mode set to 100644
File size: 322 bytes
Line 
1/*
2 * strlcpy.c
3 */
4
5#include <string.h>
6#include <klibc/compiler.h>
7
8size_t strlcpy(char *dst, const char *src, size_t size)
9{
10    size_t bytes = 0;
11    char *q = dst;
12    const char *p = src;
13    char ch;
14
15    while ((ch = *p++)) {
16        if (bytes < size)
17            *q++ = ch;
18
19        bytes++;
20    }
21
22    *q = '\0';
23    return bytes;
24}
Note: See TracBrowser for help on using the repository browser.