diff --git a/netcat.c b/netcat.c index dc295fc..277ac32 100644 --- a/netcat.c +++ b/netcat.c @@ -1408,7 +1408,8 @@ main (argc, argv) argv[1] = cp; /* head of new arg block */ fprintf (stderr, "Cmd line: "); fflush (stderr); /* I dont care if it's unbuffered or not! */ - insaved = read (0, cp, BIGSIZ); /* we're gonna fake fgets() here */ + insaved = read (0, cp, BIGSIZ-1); /* we're gonna fake fgets() here */ + cp[BIGSIZ-1] = '\0'; if (insaved <= 0) bail ("wrong"); x = findline (cp, insaved);