From: Varun Date: Wed, 21 Sep 2016 06:32:05 +0000 (-0400) Subject: No category and no search string returns everything within the radius X-Git-Tag: submit/tizen_3.0/20161108.012559~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F28%2F88928%2F1;p=platform%2Fcore%2Flocation%2Fmaps-plugin-mapzen.git No category and no search string returns everything within the radius Change-Id: Ic3348306053a5fb0a9f0a74fd586dbd07dcf429d --- diff --git a/src/mapzen_plugin.c b/src/mapzen_plugin.c index 713b9e5..6276e9c 100644 --- a/src/mapzen_plugin.c +++ b/src/mapzen_plugin.c @@ -1470,20 +1470,17 @@ EXPORT_API int maps_plugin_search_place(const maps_coordinates_h position, int d maps_place_category_destroy(category); } - if (categoryId) - place_req->categories = g_strdup_printf("%s", categoryId); + if (categoryId) { + if (strlen(categoryId) == 0) { + place_req->categories = NULL; + } else { + place_req->categories = g_strdup_printf("%s", categoryId); + } + } if (searchKeyword) place_req->search_string = g_strdup_printf("%s", searchKeyword); - if (!searchKeyword && !categoryId) { - g_free(calldata_place); - calldata_place = NULL; - g_free(place_req); - place_req = NULL; - return MAPS_ERROR_INVALID_PARAMETER; - } - if (searchKeyword) { g_free(searchKeyword); searchKeyword = NULL; @@ -1660,20 +1657,17 @@ EXPORT_API int maps_plugin_search_place_list(const maps_area_h boundary, const m maps_place_category_destroy(category); } - if (categoryId) - place_req->categories = g_strdup_printf("%s", categoryId); + if (categoryId) { + if (strlen(categoryId) == 0) { + place_req->categories = NULL; + } else { + place_req->categories = g_strdup_printf("%s", categoryId); + } + } if (searchKeyword) place_req->search_string = g_strdup_printf("%s", searchKeyword); - if (!searchKeyword && !categoryId) { - g_free(calldata_place); - calldata_place = NULL; - g_free(place_req); - place_req = NULL; - return MAPS_ERROR_INVALID_PARAMETER; - } - if (searchKeyword) { g_free(searchKeyword); searchKeyword = NULL;