---
 toys/pending/tr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
From c4c3f78afe689728c374faca86bcc25ebbaba01a Mon Sep 17 00:00:00 2001
From: Elliott Hughes <[email protected]>
Date: Sat, 5 Dec 2020 10:29:54 -0800
Subject: [PATCH] tr: fix behavior if read fails.

---
 toys/pending/tr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/toys/pending/tr.c b/toys/pending/tr.c
index e68ae464..5c630ccc 100644
--- a/toys/pending/tr.c
+++ b/toys/pending/tr.c
@@ -212,7 +212,7 @@ static void print_map(char *set1, char *set2)
 {
   int n, src, dst, prev = -1;
 
-  while ((n = read(0, toybuf, sizeof(toybuf)))) {
+  while ((n = xread(0, toybuf, sizeof(toybuf)))) {
     if (!FLAG(d) && !FLAG(s)) {
       for (dst = 0; dst < n; dst++) toybuf[dst] = TT.map[toybuf[dst]];
     } else {
-- 
2.29.2.576.ga3fc446d84-goog

_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to