mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
back out part of this change for more testing; I missed a case which caused a crash
This commit is contained in:
parent
d3ceb3fe7b
commit
d4a7d84481
@ -94,11 +94,20 @@ void ShiftCharsRight(char* aDest,PRUint32 aLength,PRUint32 anOffset,PRUint32 aCo
|
||||
* @param aCount is the number of chars to be "cut"
|
||||
*/
|
||||
void ShiftDoubleCharsLeft(char* aDest,PRUint32 aLength,PRUint32 anOffset,PRUint32 aCount) {
|
||||
PRUnichar* root=(PRUnichar*)aDest;
|
||||
PRUnichar* dst = root+anOffset;
|
||||
PRUnichar* src = root+anOffset+aCount;
|
||||
//PRUint32 theMax=aLength-anOffset;
|
||||
//PRUint32 theLength=(theMax<aCount) ? theMax : aCount;
|
||||
|
||||
memmove(dst,src,sizeof(PRUnichar)*(aLength-anOffset));
|
||||
PRUnichar* theBuf=(PRUnichar*)aDest;
|
||||
PRUnichar* first= theBuf+anOffset+aCount;
|
||||
PRUnichar* last = theBuf+aLength;
|
||||
PRUnichar* to = theBuf+anOffset;
|
||||
|
||||
//now loop over characters, shifting them left...
|
||||
while(first<=last) {
|
||||
*to=*first;
|
||||
to++;
|
||||
first++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user