RĂ©mi Bernon wine@gitlab.winehq.org wrote:
- char *buf, *cur, *tmp;
char *buf, *cur; int count = 0, buf_size = 16 * sizeof(struct hardware_msg_data);
if (!req->buffer_size) buf = NULL;
@@ -3373,13 +3373,13 @@ DECL_HANDLER(get_rawinput_buffer) if (cur + data->size > buf + buf_size) { buf_size += buf_size / 2 + extra_size;
if (!(tmp = realloc( buf, buf_size )))
cur = (char *)(cur - buf);
if (!(buf = realloc( buf, buf_size ))) { set_error( STATUS_NO_MEMORY ); return; }
cur = tmp + (cur - buf);
buf = tmp;
cur = buf + (size_t)cur; }
Reusing 'cur' as an offset doesn't look very elegant to me. Perhaps a new variable to hold the offset could be more appropriate here?