MCPcopy Index your code
hub / github.com/MapServer/MapServer / strlcpy

Function strlcpy

mapstring.c:202–226  ·  view source on GitHub ↗

* Copy src to string dst of size siz. At most siz-1 characters * will be copied. Always NUL terminates (unless siz == 0). * Returns strlen(src); if retval >= siz, truncation occurred. */

Source from the content-addressed store, hash-verified

200 * Returns strlen(src); if retval >= siz, truncation occurred.
201 */
202size_t
203strlcpy(char *dst, const char *src, size_t siz)
204{
205 register char *d = dst;
206 register const char *s = src;
207 register size_t n = siz;
208
209 /* Copy as many bytes as will fit */
210 if (n != 0 && --n != 0) {
211 do {
212 if ((*d++ = *s++) == 0)
213 break;
214 } while (--n != 0);
215 }
216
217 /* Not enough room in dst, add NUL and traverse rest of src */
218 if (n == 0) {
219 if (siz != 0)
220 *d = '\0'; /* NUL-terminate dst */
221 while (*s++)
222 ;
223 }
224
225 return(s - src - 1); /* count does not include NUL */
226}
227#endif
228
229#ifdef NEED_STRCASESTR

Callers 15

msDrawWMSLayerLowFunction · 0.85
loadFormFunction · 0.85
mainFunction · 0.85
msBuildPathFunction · 0.85
msTryBuildPathFunction · 0.85
msTryBuildPath3Function · 0.85
msDecodeHTMLEntitiesFunction · 0.85
msGetEncodedStringFunction · 0.85
msPostGISRetrieveVersionFunction · 0.85
msPostGISRetrievePKFunction · 0.85
msPostGISParseDataFunction · 0.85
msPostGISBuildSQLSRIDFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected