Files
hdf5/examples/nbcompat.c
vchoi b0ce859b2c Add the two VFD SWMR demo programs to "examples" directory.
Provide instructions on compiling and running the demos.
2021-03-04 13:36:39 -06:00

18 lines
292 B
C

#include "nbcompat.h"
size_t
strlcpy(char *dst, const char *src, size_t size)
{
char *d;
const char *s;
for (d = dst, s = src; (s - src) < size; d++, s++) {
*d = *s;
if (*s == '\0')
return s - src;
}
dst[size - 1] = '\0';
return size;
}