diff options
| author | 2020-06-07 23:34:47 +0200 | |
|---|---|---|
| committer | 2020-06-07 23:34:47 +0200 | |
| commit | ce4f7a33eb6bb539db2ad856e2c19a4cdf6ca3ee (patch) | |
| tree | 19d06556794cdfdc31e5539c35f6a42abf457939 /tools/idevicesetlocation.c | |
| parent | fb99e7c9d22c7d07b3b5fdb5064d3aa6cef88e62 (diff) | |
| download | libimobiledevice-ce4f7a33eb6bb539db2ad856e2c19a4cdf6ca3ee.tar.gz libimobiledevice-ce4f7a33eb6bb539db2ad856e2c19a4cdf6ca3ee.tar.bz2 | |
tools: Avoid copying optarg where possible
Diffstat (limited to 'tools/idevicesetlocation.c')
| -rw-r--r-- | tools/idevicesetlocation.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/idevicesetlocation.c b/tools/idevicesetlocation.c index 6332e3c..ffa285e 100644 --- a/tools/idevicesetlocation.c +++ b/tools/idevicesetlocation.c | |||
| @@ -76,7 +76,7 @@ int main(int argc, char **argv) | |||
| 76 | { NULL, 0, NULL, 0} | 76 | { NULL, 0, NULL, 0} |
| 77 | }; | 77 | }; |
| 78 | uint32_t mode = 0; | 78 | uint32_t mode = 0; |
| 79 | char *udid = NULL; | 79 | const char *udid = NULL; |
| 80 | int use_network = 0; | 80 | int use_network = 0; |
| 81 | 81 | ||
| 82 | while ((c = getopt_long(argc, argv, "dhu:nv", longopts, NULL)) != -1) { | 82 | while ((c = getopt_long(argc, argv, "dhu:nv", longopts, NULL)) != -1) { |
| @@ -90,8 +90,7 @@ int main(int argc, char **argv) | |||
| 90 | print_usage(argc, argv, 1); | 90 | print_usage(argc, argv, 1); |
| 91 | return 2; | 91 | return 2; |
| 92 | } | 92 | } |
| 93 | free(udid); | 93 | udid = optarg; |
| 94 | udid = strdup(optarg); | ||
| 95 | break; | 94 | break; |
| 96 | case 'n': | 95 | case 'n': |
| 97 | use_network = 1; | 96 | use_network = 1; |
