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

Function strncpyz

Libraries/unrar/strfn.cpp:285–293  ·  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

283
284// Safe copy: copies maxlen-1 max and for maxlen>0 returns zero terminated dest.
285void strncpyz(char *dest, const char *src, size_t maxlen)
286{
287 if (maxlen>0)
288 {
289 while (--maxlen>0 && *src!=0)
290 *dest++=*src++;
291 *dest=0;
292 }
293}
294
295
296// Safe copy: copies maxlen-1 max and for maxlen>0 returns zero terminated dest.

Callers 9

IntToExtFunction · 0.85
strncatzFunction · 0.85
SetKey20Method · 0.85
RAROpenArchiveExFunction · 0.85
RARReadHeaderFunction · 0.85
ProcessFileFunction · 0.85
GetPasswordTextFunction · 0.85
ListFileHeaderFunction · 0.85
DllVolChangeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected