projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b0f661d
)
[C_ALLOCA] (xmalloc): New function.
author
Richard M. Stallman
<rms@gnu.org>
Wed, 9 Jul 1997 19:20:34 +0000
(19:20 +0000)
committer
Richard M. Stallman
<rms@gnu.org>
Wed, 9 Jul 1997 19:20:34 +0000
(19:20 +0000)
lib-src/emacsclient.c
patch
|
blob
|
history
diff --git
a/lib-src/emacsclient.c
b/lib-src/emacsclient.c
index 2e99e9d34adc409ca34f599dd953521a4afa0fe3..999be2c2a8c14139db333ceb42a019a596085625 100644
(file)
--- a/
lib-src/emacsclient.c
+++ b/
lib-src/emacsclient.c
@@
-137,6
+137,23
@@
quote_file_name (name)
return copy;
}
+
+#ifdef C_ALLOCA
+/* Like malloc but get fatal error if memory is exhausted. */
+
+char *
+xmalloc (size)
+ unsigned int size;
+{
+ char *result = (char *) malloc (size);
+ if (result == NULL)
+ {
+ perror ("malloc");
+ exit (1);
+ }
+ return result;
+}
+#endif /* C_ALLOCA */
\f
#if !defined (HAVE_SOCKETS) && !defined (HAVE_SYSVIPC)