From 8b9700ad24da48152e2bf21ffe8feba34380c2c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Mon, 17 Nov 2003 10:12:21 +0000 Subject: [PATCH] GetInstancesFor must accept a NULL iocount and consider it as 1 git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5395 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/media/MediaRoster.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/kits/media/MediaRoster.cpp b/src/kits/media/MediaRoster.cpp index 4439863145..8b383828aa 100644 --- a/src/kits/media/MediaRoster.cpp +++ b/src/kits/media/MediaRoster.cpp @@ -2607,16 +2607,16 @@ BMediaRoster::GetInstancesFor(media_addon_id addon, int32 * io_count) { CALLED(); - if (out_id == NULL || io_count == NULL) + if (out_id == NULL) return B_BAD_VALUE; - if (*io_count <= 0) + if (io_count && *io_count <= 0) return B_BAD_VALUE; server_get_instances_for_request request; server_get_instances_for_reply reply; status_t rv; - request.maxcount = *io_count; + request.maxcount = (io_count ? *io_count : 1); request.addon_id = addon; request.addon_flavor_id = flavor; @@ -2626,7 +2626,8 @@ BMediaRoster::GetInstancesFor(media_addon_id addon, return rv; } - *io_count = reply.count; + if(io_count) + *io_count = reply.count; if (reply.count > 0) memcpy(out_id, reply.node_id, sizeof(media_node_id) * reply.count);