nicer formatting
[tridge/junkcode.git] / fillmem.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <unistd.h>
4
5 int main(int argc, char *argv[])
6 {
7         int size = 250;
8         char *p;
9
10         if (argc > 1) {
11                 size = atoi(argv[1]);
12         }
13         
14         size *= 1024 * 1024;
15
16         p = malloc(size);
17         if (!p) {
18                 fprintf(stderr,"Malloc failed!\n");
19                 exit(1);
20         }
21
22         memset(p, 0, size);
23         exit(0);
24 }