@@ 22,6 22,7 @@
#include <stdint.h>
#include <unistd.h>
#include <stdbool.h>
+#include <inttypes.h>
#include <sys/wait.h>
@@ 55,13 56,16 @@ static void dbus_method_call(GDBusConnec
if(notif_data[2] != NULL) {
free(notif_data[2]);
}
- notif_data[0] = strdup(app_name);
- notif_data[1] = strdup(summary);
- notif_data[2] = strdup(body);
+ char id_str[11];
+ snprintf(id_str, 11, "%" PRIu32, ++id);
+ notif_data[0] = id_str;
+ notif_data[1] = strdup(app_name);
+ notif_data[2] = strdup(summary);
+ notif_data[3] = strdup(body);
if(callback != NULL) {
callback(app_name, summary, body);
}
- GVariant* ret = g_variant_new("(u)", ++id);
+ GVariant* ret = g_variant_new("(u)", id);
g_dbus_method_invocation_return_value(invocation, ret);
} else if(strcmp(method_name, "GetCapabilities") == 0) {
GVariantBuilder* builder = g_variant_builder_new(G_VARIANT_TYPE("as"));