Fix text edit buffer underrun.
PiperOrigin-RevId: 723474334 Change-Id: Ibff6d83d67275e6c6333a00cabe33967913dceb1
This commit is contained in:
committed by
Copybara-Service
parent
0d4bc1de00
commit
49d07c6100
+1
-1
@@ -1106,7 +1106,7 @@ static void revealcursor(mjrRect r, mjUI* ui, const mjrContext* con) {
|
|||||||
|
|
||||||
// scan backwards
|
// scan backwards
|
||||||
int i = ui->editcursor;
|
int i = ui->editcursor;
|
||||||
while (width >= 0 && i >= ui->editscroll) {
|
while (width >= 0 && i >= ui->editscroll && i > 0) {
|
||||||
i--;
|
i--;
|
||||||
width -= con->charWidth[(unsigned char)ui->edittext[i]];
|
width -= con->charWidth[(unsigned char)ui->edittext[i]];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user