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:
Love Hörnquist Åstrand
2005-08-08 13:36:16 +00:00
parent 33ec7be97f
commit 44c8c17c29

View File

@@ -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;