Pristine Ack-5.5
[Ack-5.5.git] / modules / src / alloc / botch.c
1 /* $Id: botch.c,v 1.9 1994/06/24 11:06:39 ceriel Exp $ */
2 /*
3  * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
4  * See the copyright notice in the ACK home directory, in the file "Copyright".
5  */
6 /*      botch - write garbage over a chunk of memory, useful if you want
7                 to check if freed memory is used inappopriately.
8 */
9
10 #include "alloc.h"
11
12 void
13 botch(ptr, n)
14         register char *ptr;
15         register unsigned int n;
16 {
17         while (n >= sizeof (long))      {       
18                         /* high-speed botch loop */
19                 *(long *)ptr = 025252525252L;
20                 ptr += sizeof (long), n -= sizeof (long);
21         }
22         while (n--) *ptr++ = '\252';
23 }