diff options
author | Davidlohr Bueso | 2010-11-29 13:27:04 +0100 |
---|---|---|
committer | Karel Zak | 2010-11-30 13:18:18 +0100 |
commit | 4b5156cbfa365048c2b5e794c41cc201a49bf878 (patch) | |
tree | a9cb92ffeef7f1930e20eda70ba2f34dca1b7146 /login-utils/wall.c | |
parent | renice: rewrite usage() (diff) | |
download | kernel-qcow2-util-linux-4b5156cbfa365048c2b5e794c41cc201a49bf878.tar.gz kernel-qcow2-util-linux-4b5156cbfa365048c2b5e794c41cc201a49bf878.tar.xz kernel-qcow2-util-linux-4b5156cbfa365048c2b5e794c41cc201a49bf878.zip |
wall: use xalloc lib
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Diffstat (limited to 'login-utils/wall.c')
-rw-r--r-- | login-utils/wall.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/login-utils/wall.c b/login-utils/wall.c index 38c544266..0f4349513 100644 --- a/login-utils/wall.c +++ b/login-utils/wall.c @@ -58,6 +58,7 @@ #include <utmp.h> #include "nls.h" +#include "xalloc.h" #include "strutils.h" #include "ttymsg.h" #include "pathnames.h" @@ -242,10 +243,8 @@ makemsg(fname) exit(1); } mbufsize = sbuf.st_size; - if (!(mbuf = malloc((u_int)mbufsize))) { - (void)fprintf(stderr, _("%s: Out of memory!\n"), progname); - exit(1); - } + mbuf = xmalloc(mbufsize); + if (fread(mbuf, sizeof(*mbuf), mbufsize, fp) != mbufsize) { (void)fprintf(stderr, _("%s: can't read temporary file.\n"), progname); exit(1); |