Replaced undefined C expression.

This commit is contained in:
Marcus Meissner 2004-08-02 18:25:58 +00:00 committed by Alexandre Julliard
parent fd3d572190
commit fac7405531
1 changed files with 2 additions and 1 deletions

View File

@ -927,9 +927,10 @@ static enum packet_return packet_read_memory(struct gdb_context* gdbctx)
assert(gdbctx->in_trap); assert(gdbctx->in_trap);
/* FIXME:check in_packet_len for reading %p,%x */ /* FIXME:check in_packet_len for reading %p,%x */
if (sscanf(gdbctx->in_packet, "%p,%x", &addr, &len) != 2) return packet_error; if (sscanf(gdbctx->in_packet, "%p,%x", &addr, &len) != 2) return packet_error;
if (len <= 0) return packet_error;
if (gdbctx->trace & GDBPXY_TRC_COMMAND) if (gdbctx->trace & GDBPXY_TRC_COMMAND)
fprintf(stderr, "Read mem at %p for %u bytes\n", addr, len); fprintf(stderr, "Read mem at %p for %u bytes\n", addr, len);
for (nread = 0; nread < len > 0; nread += r, addr += r) for (nread = 0; nread < len; nread += r, addr += r)
{ {
blk_len = min(sizeof(buffer), len - nread); blk_len = min(sizeof(buffer), len - nread);
if (!ReadProcessMemory(gdbctx->process->handle, addr, buffer, blk_len, &r) || if (!ReadProcessMemory(gdbctx->process->handle, addr, buffer, blk_len, &r) ||