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

Function itoa

Libraries/unrar/strfn.cpp:330–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

328
329
330void itoa(int64 n,char *Str,size_t MaxSize)
331{
332 char NumStr[50];
333 size_t Pos=0;
334
335 int Neg=n < 0 ? 1 : 0;
336 if (Neg)
337 n=-n;
338
339 do
340 {
341 if (Pos+1>=MaxSize-Neg)
342 break;
343 NumStr[Pos++]=char(n%10)+'0';
344 n=n/10;
345 } while (n!=0);
346
347 if (Neg)
348 NumStr[Pos++]='-';
349
350 for (size_t I=0;I<Pos;I++)
351 Str[I]=NumStr[Pos-I-1];
352 Str[Pos]=0;
353}
354
355
356void itoa(int64 n,wchar *Str,size_t MaxSize)

Callers 3

ListArchiveFunction · 0.85
ListFileHeaderFunction · 0.85
uiAskReplaceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected