MCPcopy Create free account
hub / github.com/RsyncProject/rsync / read_varint_size

Function read_varint_size

io.c:1917–1926  ·  view source on GitHub ↗

Read a varint that will be used as a size_t. Rejects negative values * (which would wrap to ~SIZE_MAX) and values exceeding the supplied max. */

Source from the content-addressed store, hash-verified

1915/* Read a varint that will be used as a size_t. Rejects negative values
1916 * (which would wrap to ~SIZE_MAX) and values exceeding the supplied max. */
1917size_t read_varint_size(int f, size_t max, const char *what)
1918{
1919 int32 v = read_varint(f);
1920 if (v < 0 || (size_t)v > max) {
1921 rprintf(FERROR, "wire size %s out of range: %ld > %lu [%s]\n",
1922 what, (long)v, (unsigned long)max, who_am_i());
1923 exit_cleanup(RERR_PROTOCOL);
1924 }
1925 return (size_t)v;
1926}
1927
1928int64 read_longint(int f)
1929{

Callers 2

recv_xattr_requestFunction · 0.85
receive_xattrFunction · 0.85

Calls 3

read_varintFunction · 0.85
rprintfFunction · 0.70
who_am_iFunction · 0.70

Tested by

no test coverage detected