MCPcopy Create free account
hub / github.com/NetHack/NetHack / str_copy

Function str_copy

win/Qt/qt_str.cpp:15–27  ·  view source on GitHub ↗

Bounded string copy

Source from the content-addressed store, hash-verified

13
14// Bounded string copy
15size_t str_copy(char *dest, const char *src, size_t max)
16{
17 size_t len = 0;
18 if (max != 0) {
19 len = strlen(src);
20 if (len > max - 1) {
21 len = max - 1;
22 }
23 memcpy(dest, src, len);
24 dest[len] = '\0';
25 }
26 return len;
27}
28
29QString str_titlecase(const QString& str)
30{

Callers 4

selectNameMethod · 0.85
GetMethod · 0.85
UseRIPMethod · 0.85
qt_asknameMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected