diff options
| author | David J. MacKenzie | 1994-02-27 03:35:26 +0000 |
|---|---|---|
| committer | David J. MacKenzie | 1994-02-27 03:35:26 +0000 |
| commit | 00345809045586c1cdf77dcffd6af6085f159852 (patch) | |
| tree | 4dcd044aa6841412c8791f947bc3c5633d6db888 /lib-src | |
| parent | 978625b7e002de546fec4c5e2f583bb601599c66 (diff) | |
| download | emacs-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.c | 29 |
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 |
| 2 | This file is part of GNU Emacs. | 2 | This file is part of GNU Emacs. |
| 3 | 3 | ||
| 4 | GNU Emacs is free software; you can redistribute it and/or modify | 4 | GNU Emacs is free software; you can redistribute it and/or modify |
| 5 | it under the terms of the GNU General Public License as published by | 5 | it under the terms of the GNU General Public License as published by |
| 6 | the Free Software Foundation; either version 1, or (at your option) | 6 | the Free Software Foundation; either version 2, or (at your option) |
| 7 | any later version. | 7 | any later version. |
| 8 | 8 | ||
| 9 | GNU Emacs is distributed in the hope that it will be useful, | 9 | GNU 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 | ||
| 37 | char *malloc (); | ||
| 38 | char *realloc (); | ||
| 39 | char *xmalloc (); | ||
| 40 | char *xrealloc (); | ||
| 41 | char *getenv (); | ||
| 39 | 42 | ||
| 40 | main (argc, argv) | 43 | main (argc, argv) |
| 41 | int argc; | 44 | int argc; |
| @@ -108,22 +111,22 @@ skip_to_lf (stream) | |||
| 108 | ; | 111 | ; |
| 109 | } | 112 | } |
| 110 | 113 | ||
| 111 | int | 114 | char * |
| 112 | xmalloc (size) | 115 | xmalloc (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 | ||
| 121 | int | 124 | char * |
| 122 | xrealloc (ptr, size) | 125 | xrealloc (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) | |||
| 141 | error (s1, s2) | 144 | error (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 | } |