aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2016-10-20 15:29:10 -0500
committerRob Landley <rob@landley.net>2016-10-20 15:29:10 -0500
commit817f059d48cf3e7bee267efd69cded04284494b4 (patch)
treef0eaf357ef9293528bd300fa1fefa77dc0cf0cfd /lib
parent3214c87ccf7f4a3426fe0d30296af1af85fc864e (diff)
downloadtoybox-817f059d48cf3e7bee267efd69cded04284494b4.tar.gz
Allow out and escout to be NULL in crunch_str()
Diffstat (limited to 'lib')
-rw-r--r--lib/linestack.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/linestack.c b/lib/linestack.c
index eef790b5..e717a9bb 100644
--- a/lib/linestack.c
+++ b/lib/linestack.c
@@ -106,7 +106,8 @@ int crunch_str(char **str, int width, FILE *out, char *escmore,
}
col = width-columns;
if (col<1) break;
- col = escout(out, col, wc);
+ if (escout) col = escout(out, col, wc);
+ else if (out) fwrite(end, bytes, 1, out);
}
*str = end;