MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / wcsncpyz

Function wcsncpyz

Libraries/unrar/strfn.cpp:297–305  ·  view source on GitHub ↗

Safe copy: copies maxlen-1 max and for maxlen>0 returns zero terminated dest.

Source from the content-addressed store, hash-verified

295
296// Safe copy: copies maxlen-1 max and for maxlen>0 returns zero terminated dest.
297void wcsncpyz(wchar *dest, const wchar *src, size_t maxlen)
298{
299 if (maxlen>0)
300 {
301 while (--maxlen>0 && *src!=0)
302 *dest++=*src++;
303 *dest=0;
304 }
305}
306
307
308// Safe append: resulting dest length cannot exceed maxlen and dest

Callers 15

RestoreMethod · 0.85
TestMethod · 0.85
InitLogOptionsFunction · 0.85
GetTextMethod · 0.85
SetErrArcNameMethod · 0.85
wcsncatzFunction · 0.85
operator =Method · 0.85
OpenMethod · 0.85
CreateMethod · 0.85
RenameMethod · 0.85
ParseArgMethod · 0.85
ReadConfigMethod · 0.85

Calls

no outgoing calls

Tested by 2

TestMethod · 0.68
TestMethod · 0.68