mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
([NSCString -cString]): Malloc extra byte for '\0' terminator.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@497 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8d05c2ef5b
commit
7b4db115ff
1 changed files with 1 additions and 1 deletions
|
@ -78,7 +78,7 @@
|
|||
{
|
||||
char *r;
|
||||
|
||||
OBJC_MALLOC(r, char, _count);
|
||||
OBJC_MALLOC(r, char, _count+1);
|
||||
memcpy(r, _contents_chars, _count);
|
||||
r[_count] = '\0';
|
||||
[[[MallocAddress alloc] initWithAddress:r] autorelease];
|
||||
|
|
Loading…
Reference in a new issue