rev: use xalloc for memory allocation
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
This commit is contained in:
parent
f0961db21f
commit
3924d0f169
|
@ -59,6 +59,7 @@
|
|||
#include <signal.h>
|
||||
|
||||
#include "nls.h"
|
||||
#include "xalloc.h"
|
||||
#include "widechar.h"
|
||||
|
||||
wchar_t *buf;
|
||||
|
@ -117,9 +118,7 @@ int main(int argc, char *argv[])
|
|||
filename = *argv++;
|
||||
}
|
||||
|
||||
buf = malloc(bufsiz * sizeof(wchar_t));
|
||||
if (!buf)
|
||||
err(EXIT_FAILURE, _("malloc failed"));
|
||||
buf = xmalloc(bufsiz * sizeof(wchar_t));
|
||||
|
||||
while (fgetws(buf, bufsiz, fp)) {
|
||||
len = wcslen(buf);
|
||||
|
|
Loading…
Reference in New Issue