mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 08:41:03 +00:00
Use location/length instead of start/end.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@109 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
10233264fd
commit
e575041399
2 changed files with 30 additions and 23 deletions
|
@ -32,9 +32,9 @@
|
|||
- initWithCString: (char*)aCharPtr range: (IndexRange)aRange
|
||||
{
|
||||
[super initWithType:@encode(char)];
|
||||
_count = aRange.end - aRange.start;
|
||||
_count = aRange.length;
|
||||
OBJC_MALLOC(_contents_chars, char, _count+1);
|
||||
memcpy(_contents_chars, aCharPtr + aRange.start, _count);
|
||||
memcpy(_contents_chars, aCharPtr + aRange.location, _count);
|
||||
_contents_chars[_count] = '\0';
|
||||
return self;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue