MCPcopy Create free account
hub / github.com/assaultcube/AC / copystring

Function copystring

source/src/tools.h:123–123  ·  view source on GitHub ↗

pragma GCC diagnostic ignored "-Wstringop-truncation" // moved to makefile, because it doesn't work from precompiled header

Source from the content-addressed store, hash-verified

121inline void vformatstring_(char* d, const char* fmt, va_list v, int len = MAXSTRLEN) { _vsnprintf(d, len, fmt, v); d[len - 1] = 0; }
122//#pragma GCC diagnostic ignored "-Wstringop-truncation" // moved to makefile, because it doesn't work from precompiled header
123inline char *copystring(char *d, const char *s, size_t len = MAXSTRLEN) { strncpy(d, s, len); d[len-1] = 0; return d; }
124inline char *concatstring(char *d, const char *s, size_t len = MAXSTRLEN) { size_t used = strlen(d); return used < len ? copystring(d+used, s, len-used) : d; }
125extern char *concatformatstring(char *d, const char *s, ...) PRINTFARGS(2, 3);
126

Callers 15

textureloadFunction · 0.85
textureslotusageFunction · 0.85
openMethod · 0.85
hiddenpwdFunction · 0.85
initMethod · 0.85
checkblacklistFunction · 0.85
addentryMethod · 0.85
initMethod · 0.85
readMethod · 0.85
getmsglineMethod · 0.85
addnameMethod · 0.85
parsevitasFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected