for (l = list; l != NULL; l = l->next) {
if (!l->data) continue;
- sprintf(absolute_path, "%s%s", directory,
+ snprintf(absolute_path, sizeof(path), "%s%s", directory,
(char *)l->data);
BT_INFO("filename: %s, absoulte_path: %s",
(char *)l->data, absolute_path);
if (stat(absolute_path, &st) == -1) {
- BT_INFO("stat failed: %s (%d)\n",
- strerror(errno), errno);
+ BT_INFO("stat failed: (%d)\n", errno);
continue;
}
} else if (!g_strcmp0(type, "date")) {
- tm = localtime(&(object->first_created));
+ localtime_r(&(object->first_created), tm);
value[1] = ((tm->tm_year+1900) >> 8) & 0xFF;
value[0] = (tm->tm_year+1900) & 0xFF;
return BLUETOOTH_ERROR_INTERNAL;
*len = info->value_length;
- *value = (char *)malloc(sizeof(char *)*(*len));
+ *value = (char *)malloc(sizeof(char)*(*len));
memcpy(*value, info->char_value, *len);
return BLUETOOTH_ERROR_NONE;
out_param = g_variant_new_from_data((const GVariantType *)"i",
result, sizeof(int), TRUE, NULL, NULL);
- g_dbus_method_invocation_return_value(req_info->context,
+ if (req_info) {
+ g_dbus_method_invocation_return_value(req_info->context,
g_variant_new("(iv)", status, out_param));
- _bt_delete_request_list(req_info->req_id);
+ _bt_delete_request_list(req_info->req_id);
+ }
g_variant_unref(result);
}