File: zmalloc.c

package info (click to toggle)
acorn-fdisk 3.0.6-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,068 kB
  • sloc: ansic: 5,422; makefile: 99
file content (25 lines) | stat: -rw-r--r-- 430 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * lib/util/zmalloc.c
 *
 * Copyright (C) 1997,1998 Russell King
 */
#include <stdlib.h>
#include <string.h>

#include "zmalloc.h"

/* Function: void *zmalloc (size_t size)
 * Purpose : malloc some memory (and clear it)
 * Params  : size - number of bytes to malloc
 * Returns : pointer to allocated memory
 */
void *zmalloc (size_t size)
{
  void *ptr = malloc (size);

  if (ptr)
    memset (ptr, 0, size);

  return ptr;
}