Return to cut.c CVS log | Up to [local] / src / usr.bin / cut |
version 1.18, 2014/02/02 11:44:01 | version 1.19, 2015/08/18 17:10:48 | ||
---|---|---|---|
|
|
||
output = 0; | output = 0; | ||
if (lbuf[len - 1] != '\n') { | if (lbuf[len - 1] != '\n') { | ||
/* no newline at the end of the last line so add one */ | /* no newline at the end of the last line so add one */ | ||
if ((tbuf = (char *)malloc(len + 1)) == NULL) | if ((tbuf = malloc(len + 1)) == NULL) | ||
err(1, NULL); | err(1, NULL); | ||
memcpy(tbuf, lbuf, len); | memcpy(tbuf, lbuf, len); | ||
tbuf[len] = '\n'; | tbuf[len] = '\n'; |