aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/cut.c
diff options
context:
space:
mode:
Diffstat (limited to 'toys/posix/cut.c')
-rw-r--r--toys/posix/cut.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/toys/posix/cut.c b/toys/posix/cut.c
index 2676d932..f61073f1 100644
--- a/toys/posix/cut.c
+++ b/toys/posix/cut.c
@@ -70,14 +70,15 @@ int unicolumns(char *start, unsigned columns)
return ss-start;
}
-
// Apply selections to an input line, producing output
static void cut_line(char **pline, long len)
{
unsigned *pairs = (void *)toybuf;
- char *line = *pline;
+ char *line;
int i, j;
+ if (!pline) return;
+ line = *pline;
if (len && line[len-1]=='\n') line[--len] = 0;
// Loop through selections