mirror of
https://github.com/paxed/dgamelaunch.git
synced 2025-07-31 01:24:43 +02:00
Just to be sure, make the tty playback buffer explicitly null terminated.
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@486 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
parent
dfc414aa19
commit
cd4ae1a5f0
@ -136,7 +136,7 @@ ttyread (FILE * fp, Header * h, char **buf, int pread)
|
|||||||
exit (-21);
|
exit (-21);
|
||||||
}
|
}
|
||||||
|
|
||||||
*buf = malloc (h->len);
|
*buf = malloc (h->len + 1);
|
||||||
if (*buf == NULL)
|
if (*buf == NULL)
|
||||||
{
|
{
|
||||||
perror ("malloc");
|
perror ("malloc");
|
||||||
@ -148,6 +148,7 @@ ttyread (FILE * fp, Header * h, char **buf, int pread)
|
|||||||
fseek (fp, offset, SEEK_SET);
|
fseek (fp, offset, SEEK_SET);
|
||||||
return READ_EOF;
|
return READ_EOF;
|
||||||
}
|
}
|
||||||
|
(*buf)[h->len] = 0;
|
||||||
return READ_DATA;
|
return READ_DATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user