/* I is now either a user-defined length, the number of non-null
characters, or FETCHLIMIT. */
*length = i * width;
- *buffer = xmalloc (*length);
+ *buffer = (gdb_byte *) xmalloc (*length);
memcpy (*buffer, contents, *length);
err = 0;
}
err = read_string (addr, *length, width, fetchlimit,
byte_order, buffer, length);
- if (err)
+ if (err != 0)
{
xfree (*buffer);
- memory_error (err, addr);
+ memory_error (TARGET_XFER_E_IO, addr);
}
}
{
gdb_byte *buffer;
- buffer = alloca (TYPE_LENGTH (type));
+ buffer = (gdb_byte *) alloca (TYPE_LENGTH (type));
pack_long (buffer, type, value);
obstack_grow (output, buffer, TYPE_LENGTH (type));
}