projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-19981114-1
[rocksndiamonds.git]
/
src
/
misc.c
diff --git
a/src/misc.c
b/src/misc.c
index c560ae4bc0f6c3ae2931b82d5d5a9f5a4f9e39f6..a7e52dcc4a71aaf2273ae986ec1ff2551ed46a50 100644
(file)
--- a/
src/misc.c
+++ b/
src/misc.c
@@
-446,6
+446,18
@@
void *checked_malloc(unsigned long size)
return ptr;
}
return ptr;
}
+void *checked_calloc(unsigned long size)
+{
+ void *ptr;
+
+ ptr = calloc(1, size);
+
+ if (ptr == NULL)
+ Error(ERR_EXIT, "cannot allocate %d bytes -- out of memory", size);
+
+ return ptr;
+}
+
#define TRANSLATE_KEYSYM_TO_KEYNAME 0
#define TRANSLATE_KEYSYM_TO_X11KEYNAME 1
#define TRANSLATE_X11KEYNAME_TO_KEYSYM 2
#define TRANSLATE_KEYSYM_TO_KEYNAME 0
#define TRANSLATE_KEYSYM_TO_X11KEYNAME 1
#define TRANSLATE_X11KEYNAME_TO_KEYSYM 2