aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorDavid J. MacKenzie1994-02-27 03:35:26 +0000
committerDavid J. MacKenzie1994-02-27 03:35:26 +0000
commit00345809045586c1cdf77dcffd6af6085f159852 (patch)
tree4dcd044aa6841412c8791f947bc3c5633d6db888 /lib-src
parent978625b7e002de546fec4c5e2f583bb601599c66 (diff)
downloademacs-00345809045586c1cdf77dcffd6af6085f159852.tar.gz
emacs-00345809045586c1cdf77dcffd6af6085f159852.zip
* cvtmail.c: Declare malloc, realloc, xmalloc, xrealloc.
(xmalloc, xrealloc): Return char *, not int. (error): Write to stderr, not stdout.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/cvtmail.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/lib-src/cvtmail.c b/lib-src/cvtmail.c
index 1f3b8ff9f9e..c1fec8792c5 100644
--- a/lib-src/cvtmail.c
+++ b/lib-src/cvtmail.c
@@ -1,9 +1,9 @@
1/* Copyright (C) 1985 Free Software Foundation 1/* Copyright (C) 1985, 1994 Free Software Foundation
2This file is part of GNU Emacs. 2This file is part of GNU Emacs.
3 3
4GNU Emacs is free software; you can redistribute it and/or modify 4GNU Emacs is free software; you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by 5it under the terms of the GNU General Public License as published by
6the Free Software Foundation; either version 1, or (at your option) 6the Free Software Foundation; either version 2, or (at your option)
7any later version. 7any later version.
8 8
9GNU Emacs is distributed in the hope that it will be useful, 9GNU Emacs is distributed in the hope that it will be useful,
@@ -29,13 +29,16 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
29 * be mv'ed to ~/mbox, and then have rmail invoked on them. 29 * be mv'ed to ~/mbox, and then have rmail invoked on them.
30 * 30 *
31 * Author: Larry Kolodney, 1985 31 * Author: Larry Kolodney, 1985
32
33 * RMS, 2 Sept 85: Removed fix maximums on file name sizes.
34 */ 32 */
35 33
36 34
37#include <stdio.h> 35#include <stdio.h>
38 36
37char *malloc ();
38char *realloc ();
39char *xmalloc ();
40char *xrealloc ();
41char *getenv ();
39 42
40main (argc, argv) 43main (argc, argv)
41 int argc; 44 int argc;
@@ -108,22 +111,22 @@ skip_to_lf (stream)
108 ; 111 ;
109} 112}
110 113
111int 114char *
112xmalloc (size) 115xmalloc (size)
113 int size; 116 unsigned size;
114{ 117{
115 int result = malloc (size); 118 char *result = malloc (size);
116 if (!result) 119 if (!result)
117 fatal ("virtual memory exhausted", 0); 120 fatal ("virtual memory exhausted", 0);
118 return result; 121 return result;
119} 122}
120 123
121int 124char *
122xrealloc (ptr, size) 125xrealloc (ptr, size)
123 char *ptr; 126 char *ptr;
124 int size; 127 unsigned size;
125{ 128{
126 int result = realloc (ptr, size); 129 char *result = realloc (ptr, size);
127 if (!result) 130 if (!result)
128 fatal ("virtual memory exhausted"); 131 fatal ("virtual memory exhausted");
129 return result; 132 return result;
@@ -141,7 +144,7 @@ fatal (s1, s2)
141error (s1, s2) 144error (s1, s2)
142 char *s1, *s2; 145 char *s1, *s2;
143{ 146{
144 printf ("cvtmail: "); 147 fprintf (stderr, "cvtmail: ");
145 printf (s1, s2); 148 fprintf (stderr, s1, s2);
146 printf ("\n"); 149 fprintf (stderr, "\n");
147} 150}