MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / dStrcpyl

Function dStrcpyl

Engine/source/core/strings/stringFunctions.cpp:302–329  ·  view source on GitHub ↗

copy a list of src's into dst the list of src's MUST be terminated by a NULL parameter dStrccpyl(dst, sizeof(dst), src1, src2, NULL);

Source from the content-addressed store, hash-verified

300// the list of src's MUST be terminated by a NULL parameter
301// dStrccpyl(dst, sizeof(dst), src1, src2, NULL);
302char* dStrcpyl(char *dst, dsize_t dstSize, ...)
303{
304 const char* src = NULL;
305 char *p = dst;
306
307 AssertFatal(dstSize > 0, "dStrcpyl: destination size is set zero");
308 dstSize--; // leave room for string termination
309
310 va_list args;
311 va_start(args, dstSize);
312
313 // concatenate each src to end of dst
314 while ( (src = va_arg(args, const char*)) != NULL )
315 {
316 while( dstSize && *src )
317 {
318 *p++ = *src++;
319 dstSize--;
320 }
321 }
322
323 va_end(args);
324
325 // make sure the string is terminated
326 *p = 0;
327
328 return dst;
329}
330
331
332S32 dStrcmp(const UTF16 *str1, const UTF16 *str2)

Callers 2

executeFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected