aboutsummaryrefslogtreecommitdiff
path: root/hw/qdev-properties.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2009-08-13 16:26:52 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-08-13 16:26:52 +0000
commitbc19fcaa1b6d2a89b96793c7e8890978fc477f51 (patch)
tree04abb7a583edfe033d4b5d2270958f8177555917 /hw/qdev-properties.c
parentaa0cba4a62550a4110231c6faa159dbfe3ce33d6 (diff)
Unbreak Sparc32 and PPC
Convert qdev ptr type to chr, allow a NULL pointer. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/qdev-properties.c')
-rw-r--r--hw/qdev-properties.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
index df3d20902a..c9703c261c 100644
--- a/hw/qdev-properties.c
+++ b/hw/qdev-properties.c
@@ -173,7 +173,12 @@ PropertyInfo qdev_prop_drive = {
static int print_chr(DeviceState *dev, Property *prop, char *dest, size_t len)
{
CharDriverState **ptr = qdev_get_prop_ptr(dev, prop);
- return snprintf(dest, len, "%s", (*ptr)->label);
+
+ if (*ptr && (*ptr)->label) {
+ return snprintf(dest, len, "%s", (*ptr)->label);
+ } else {
+ return snprintf(dest, len, "<null>");
+ }
}
PropertyInfo qdev_prop_chr = {