Initial import

This commit is contained in:
Mikael Pettersson
2013-07-03 16:29:42 +00:00
commit 7c189dd488
36 changed files with 5441 additions and 0 deletions

20
as/emalloc.c Normal file
View File

@@ -0,0 +1,20 @@
/*
* emalloc.c
*/
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "emalloc.h"
void *emalloc(size_t nrbytes)
{
void *p;
p = malloc(nrbytes);
if (!p) {
fprintf(stderr, "malloc(%zu) failed: %s\n", nrbytes, strerror(errno));
exit(1);
}
return p;
}