iomenu

interactive text selection menu
Log | Files | Refs | README | LICENSE

commit e844872a71215b44a5e7c8fe7f98508f9bccc5c5
parent e62b3c99fc9a7198c96ef70e15ad84c73534c84b
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Wed, 29 Nov 2017 20:57:16 +0100

check malloc()

Diffstat:
Miomenu.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/iomenu.c b/iomenu.c @@ -119,7 +119,8 @@ read_stdin(void) size = BUFSIZ; off = 0; - buf = malloc(size); + if (!(buf = malloc(size))) + die("malloc"); while ((len = read(STDIN_FILENO, buf + off, size - off)) > 0) { off += len; if (off >= size >> 1) {