MCPcopy Create free account
hub / github.com/Tripwire/tripwire-open-source / swab

Function swab

src/twadmin/twadmincl.cpp:68–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66//Provide a swab() impl. from glibc, for platforms that don't have one
67#if !HAVE_SWAB || NEEDS_SWAB_IMPL
68void swab(const void* bfrom, void* bto, ssize_t n)
69{
70 const char* from = (const char*)bfrom;
71 char* to = (char*)bto;
72
73 n &= ~((ssize_t)1);
74 while (n > 1)
75 {
76 const char b0 = from[--n], b1 = from[--n];
77 to[n] = b0;
78 to[n + 1] = b1;
79 }
80}
81#endif
82
83// forwards

Callers 1

ChangePassphraseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected