MCPcopy Index your code
hub / github.com/RsyncProject/rsync / read_vstring

Function read_vstring

io.c:2004–2021  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2002}
2003
2004int read_vstring(int f, char *buf, int bufsize)
2005{
2006 int len = read_byte(f);
2007
2008 if (len & 0x80)
2009 len = (len & ~0x80) * 0x100 + read_byte(f);
2010
2011 if (len >= bufsize) {
2012 rprintf(FERROR, "over-long vstring received (%d > %d)\n",
2013 len, bufsize - 1);
2014 return -1;
2015 }
2016
2017 if (len)
2018 read_buf(f, buf, len);
2019 buf[len] = '\0';
2020 return len;
2021}
2022
2023/* Populate a sum_struct with values from the socket. This is
2024 * called by both the sender and the receiver. */

Callers 2

read_ndx_and_attrsFunction · 0.85
recv_negotiate_strFunction · 0.85

Calls 3

read_byteFunction · 0.85
rprintfFunction · 0.70
read_bufFunction · 0.70

Tested by

no test coverage detected