mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
fixed off-by-one error; r=harishd
This commit is contained in:
parent
a1e70679b1
commit
4e97c0877e
@ -282,11 +282,13 @@ inline PRInt32 FindChar1(const char* aDest,PRUint32 aDestLength,PRInt32 anOffset
|
||||
}
|
||||
else {
|
||||
|
||||
PRInt32 theMax = aDestLength-anOffset;
|
||||
char theChar=(char)aChar;
|
||||
const char* result=(const char*)memchr(left, theChar, theMax);
|
||||
if(result) {
|
||||
return result-aDest;
|
||||
PRInt32 theMax = end-left;
|
||||
if(0<theMax) {
|
||||
char theChar=(char)aChar;
|
||||
const char* result=(const char*)memchr(left, theChar, theMax);
|
||||
if(result) {
|
||||
return result-aDest;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user