back out part of this change for more testing; I missed a case which caused a crash

This commit is contained in:
rickg%netscape.com 1999-09-18 01:09:48 +00:00
Родитель d3ceb3fe7b
Коммит d4a7d84481
1 изменённых файлов: 13 добавлений и 4 удалений

Просмотреть файл

@ -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++;
}
}