make writenet take const void * and size_t, abort if size it too large
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15844 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -323,13 +323,15 @@ netflush(void)
|
||||
* len - How many bytes to write
|
||||
*/
|
||||
void
|
||||
writenet(unsigned char *ptr, int len)
|
||||
writenet(const void *ptr, size_t len)
|
||||
{
|
||||
/* flush buffer if no room for new data) */
|
||||
while ((&netobuf[BUFSIZ] - nfrontp) < len) {
|
||||
/* if this fails, don't worry, buffer is a little big */
|
||||
netflush();
|
||||
}
|
||||
if ((&netobuf[BUFSIZ] - nfrontp) < len)
|
||||
abort();
|
||||
|
||||
memmove(nfrontp, ptr, len);
|
||||
nfrontp += len;
|
||||
|
Reference in New Issue
Block a user