Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/compat/strlcpy.c # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / compat / strlcpy.c` 13 lines ยท 247 bytes Raw Blame History 1 #include "../git-compat-util.h" 2 3 size_t gitstrlcpy(char *dest, const char *src, size_t size) 4 { 5 size_t ret = strlen(src); 6 7 if (size) { 8 size_t len = (ret >= size) ? size - 1 : ret; 9 memcpy(dest, src, len); 10 dest[len] = '\0'; 11 } 12 return ret; 13 }