DEBUG("\t client_pid = %d\n", client_pid);
for (int i = 0; i < count; i++) {
- g_variant_iter_loop (iter, "(ss)", &service_info[i].ExecutionType, &service_info[i].ExeCmd);
-
- DEBUG("\t service_info[%d].ExecutionType = %s\n", i, service_info[i].ExecutionType);
- DEBUG("\t service_info[%d].ExeCmd = %s\n", i, service_info[i].ExeCmd);
+ if (g_variant_iter_loop (iter, "(ss)", &service_info[i].ExecutionType, &service_info[i].ExeCmd)) {
+ DEBUG("\t service_info[%d].ExecutionType = %s\n", i, service_info[i].ExecutionType);
+ DEBUG("\t service_info[%d].ExeCmd = %s\n", i, service_info[i].ExeCmd);
+ } else {
+ DEBUG("\t no more items to iterate!!!\n");
+ break;
+ }
}
g_variant_iter_free (iter);