| tstrlcpy.c - iomenu - interactive terminal-based selection menu | |||
| git clone git://bitreich.org/iomenu git://hg6vgqziawt5s4dj.onion/iomenu (git://bitreich.org) | |||
| Log | |||
| Files | |||
| Refs | |||
| Tags | |||
| README | |||
| LICENSE | |||
| --- | |||
| tstrlcpy.c (235B) | |||
| --- | |||
| 1 #include "compat.h" | |||
| 2 | |||
| 3 #include <string.h> | |||
| 4 | |||
| 5 size_t | |||
| 6 strlcpy(char *buf, char const *str, size_t sz) | |||
| 7 { | |||
| 8 size_t len, cpy; | |||
| 9 | |||
| 10 len = strlen(str); | |||
| 11 cpy = (len > sz) ? (sz) : (len); | |||
| 12 memcpy(buf, str, cpy + 1); | |||
| 13 buf[sz - 1] = '\0'; | |||
| 14 return len; | |||
| 15 } |
Response: application/gopher-menu
| Original URL | gopher://bitreich.org/1/scm/iomenu/file/src/compat/strlcpy.c.gph |
|---|---|
| Content-Type | application/gopher-menu; charset=utf-8 |