gs: avoid 6c type propagation / constant folding issue for set_cb_end()

6c changed "- cmd_lagest_size + 1" into a *unsigned* 32bit constant. which
got added to 64bit pointer making pcb->limit > pcb->end resulting
in errors for partial commands in the buffer. removing the parentesis
propagates the operation to 64bit.
This commit is contained in:
cinap_lenrek 2015-04-17 06:18:43 +02:00
parent 57ad566dfc
commit 81cbff917f

View file

@ -119,7 +119,7 @@ private void
set_cb_end(command_buf_t *pcb, const byte *end) set_cb_end(command_buf_t *pcb, const byte *end)
{ {
pcb->end = end; pcb->end = end;
pcb->limit = pcb->data + (pcb->size - cmd_largest_size + 1); pcb->limit = pcb->data + pcb->size - cmd_largest_size + 1;
if ( pcb->limit > pcb->end ) if ( pcb->limit > pcb->end )
pcb->limit = pcb->end; pcb->limit = pcb->end;
} }