diff options
author | 2024-12-30 14:10:11 +0100 | |
---|---|---|
committer | 2024-12-30 14:10:11 +0100 | |
commit | 6b09092395181b88f5623c5859d74774b8b5565b (patch) | |
tree | 5531cf656135fe3d4d9f1dfd4a68dd08003b82c4 | |
parent | 3fdaed78de8000af3b5d19d953eccd80a208ae2c (diff) | |
download | libusbmuxd-6b09092395181b88f5623c5859d74774b8b5565b.tar.gz libusbmuxd-6b09092395181b88f5623c5859d74774b8b5565b.tar.bz2 |
Use libusbmuxd_version() to construct client version string
-rw-r--r-- | src/libusbmuxd.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libusbmuxd.c b/src/libusbmuxd.c index 1cf44a1..4fecd46 100644 --- a/src/libusbmuxd.c +++ b/src/libusbmuxd.c @@ -95,7 +95,6 @@ static char* stpncpy(char *dst, const char *src, size_t len) #endif #include <plist/plist.h> -#define PLIST_CLIENT_VERSION_STRING PACKAGE_STRING #define PLIST_LIBUSBMUX_VERSION 3 static char *bundle_id = NULL; @@ -116,6 +115,9 @@ static int libusbmuxd_debug = 0; #ifndef PACKAGE #define PACKAGE "libusbmuxd" #endif +#ifndef PACKAGE_NAME +#define PACKAGE_NAME PACKAGE +#endif #define LIBUSBMUXD_DEBUG(level, format, ...) if (level <= libusbmuxd_debug) fprintf(stderr, ("[" PACKAGE "] " format), __VA_ARGS__); fflush(stderr); #define LIBUSBMUXD_ERROR(format, ...) LIBUSBMUXD_DEBUG(0, format, __VA_ARGS__) @@ -722,6 +724,9 @@ static void get_prog_name() static plist_t create_plist_message(const char* message_type) { + char client_version[128]; + snprintf(client_version, 128, PACKAGE_NAME " %s", libusbmuxd_version()); +printf("%s\n", client_version); if (!bundle_id) { get_bundle_id(); } @@ -732,7 +737,7 @@ static plist_t create_plist_message(const char* message_type) if (bundle_id) { plist_dict_set_item(plist, "BundleID", plist_new_string(bundle_id)); } - plist_dict_set_item(plist, "ClientVersionString", plist_new_string(PLIST_CLIENT_VERSION_STRING)); + plist_dict_set_item(plist, "ClientVersionString", plist_new_string(client_version)); plist_dict_set_item(plist, "MessageType", plist_new_string(message_type)); if (prog_name) { plist_dict_set_item(plist, "ProgName", plist_new_string(prog_name)); |