Mercurial > sci
comparison scictl/scictl.c @ 63:67470b67e460
misc: remove unneeded code
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 18 Aug 2022 12:29:28 +0200 |
parents | 8be8188d61a5 |
children | 71cd8447e3a4 |
comparison
equal
deleted
inserted
replaced
62:eaebcc612a0d | 63:67470b67e460 |
---|---|
74 if (strcmp(path, "-") == 0) | 74 if (strcmp(path, "-") == 0) |
75 fp = stdin; | 75 fp = stdin; |
76 else if (!(fp = fopen(path, "r"))) | 76 else if (!(fp = fopen(path, "r"))) |
77 util_die("abort: %s: %s\n", path, strerror(errno)); | 77 util_die("abort: %s: %s\n", path, strerror(errno)); |
78 | 78 |
79 if (!(str = open_memstream(&console, &consolesz))) | 79 str = util_open_memstream(&console, &consolesz); |
80 util_die("abort: open_memstream: %s\n", strerror(errno)); | |
81 | 80 |
82 while ((nr = fread(buf, 1, sizeof (buf), fp)) > 0) | 81 while ((nr = fread(buf, 1, sizeof (buf), fp)) > 0) |
83 fwrite(buf, 1, nr, str); | 82 fwrite(buf, 1, nr, str); |
84 | 83 |
85 if ((ferror(fp) && !feof(fp)) || (ferror(str) && !feof(str))) | 84 if ((ferror(fp) && !feof(fp)) || (ferror(str) && !feof(str))) |