mirror of
https://github.com/proxytunnel/proxytunnel.git
synced 2026-01-23 02:34:59 +00:00
Merge pull request #83 from tofurky/unterminated_string_calloc
Avoid printing unterminated string in readline()
This commit is contained in:
commit
8b2661ecd7
1 changed files with 1 additions and 1 deletions
2
io.c
2
io.c
|
|
@ -57,7 +57,7 @@ int readline(PTSTREAM *pts) {
|
|||
|
||||
if( args_info.verbose_flag ) {
|
||||
/* Copy line of data into dstr without trailing newline */
|
||||
char *dstr = malloc(strlen(buf) + 1);
|
||||
char *dstr = calloc(1, strlen(buf) + 1);
|
||||
strncpy( dstr, buf, strlen(buf));
|
||||
if (strcmp(dstr, ""))
|
||||
message( " <- %s\n", dstr );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue