Skip to content

Commit 6b09092

Browse files
committed
Use libusbmuxd_version() to construct client version string
1 parent 3fdaed7 commit 6b09092

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/libusbmuxd.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ static char* stpncpy(char *dst, const char *src, size_t len)
9595
#endif
9696

9797
#include <plist/plist.h>
98-
#define PLIST_CLIENT_VERSION_STRING PACKAGE_STRING
9998
#define PLIST_LIBUSBMUX_VERSION 3
10099

101100
static char *bundle_id = NULL;
@@ -116,6 +115,9 @@ static int libusbmuxd_debug = 0;
116115
#ifndef PACKAGE
117116
#define PACKAGE "libusbmuxd"
118117
#endif
118+
#ifndef PACKAGE_NAME
119+
#define PACKAGE_NAME PACKAGE
120+
#endif
119121
#define LIBUSBMUXD_DEBUG(level, format, ...) if (level <= libusbmuxd_debug) fprintf(stderr, ("[" PACKAGE "] " format), __VA_ARGS__); fflush(stderr);
120122
#define LIBUSBMUXD_ERROR(format, ...) LIBUSBMUXD_DEBUG(0, format, __VA_ARGS__)
121123

@@ -722,6 +724,9 @@ static void get_prog_name()
722724

723725
static plist_t create_plist_message(const char* message_type)
724726
{
727+
char client_version[128];
728+
snprintf(client_version, 128, PACKAGE_NAME " %s", libusbmuxd_version());
729+
printf("%s\n", client_version);
725730
if (!bundle_id) {
726731
get_bundle_id();
727732
}
@@ -732,7 +737,7 @@ static plist_t create_plist_message(const char* message_type)
732737
if (bundle_id) {
733738
plist_dict_set_item(plist, "BundleID", plist_new_string(bundle_id));
734739
}
735-
plist_dict_set_item(plist, "ClientVersionString", plist_new_string(PLIST_CLIENT_VERSION_STRING));
740+
plist_dict_set_item(plist, "ClientVersionString", plist_new_string(client_version));
736741
plist_dict_set_item(plist, "MessageType", plist_new_string(message_type));
737742
if (prog_name) {
738743
plist_dict_set_item(plist, "ProgName", plist_new_string(prog_name));

0 commit comments

Comments
 (0)