Add some notes to cat.c
This commit is contained in:
parent
0ecd45a51d
commit
613b12f0de
@ -86,6 +86,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
if(!upresence and (2 * (strlen(buf) + strlen(newbuf)) >= buflen))
|
if(!upresence and (2 * (strlen(buf) + strlen(newbuf)) >= buflen))
|
||||||
{
|
{
|
||||||
|
/* Rewrite this bit to use realloc and/or memcpy? */
|
||||||
tmpbuf = malloc(2 * (strlen(buf) + strlen(newbuf)));
|
tmpbuf = malloc(2 * (strlen(buf) + strlen(newbuf)));
|
||||||
strcpy(tmpbuf, buf);
|
strcpy(tmpbuf, buf);
|
||||||
free(buf);
|
free(buf);
|
||||||
|
Loading…
Reference in New Issue
Block a user