* target.c (target_read_string): Guard against null.
2007-08-08 Michael Snyder <msnyder@access-company.com>
+ * target.c (target_read_string): Guard against null.
+
* varobj.c (value_of_root): Move alloc after return to avoid leak.
* tui/tui-layout.c (tui_set_layout): Dead code, dead variable.
char *bufptr;
unsigned int nbytes_read = 0;
+ gdb_assert (string);
+
/* Small for testing. */
buffer_allocated = 4;
buffer = xmalloc (buffer_allocated);
nbytes_read += tlen;
}
done:
+ *string = buffer;
if (errnop != NULL)
*errnop = errcode;
- if (string != NULL)
- *string = buffer;
return nbytes_read;
}