From ce4f7a33eb6bb539db2ad856e2c19a4cdf6ca3ee Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Sun, 7 Jun 2020 23:34:47 +0200 Subject: tools: Avoid copying optarg where possible --- tools/idevicesetlocation.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tools/idevicesetlocation.c') 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) { NULL, 0, NULL, 0} }; uint32_t mode = 0; - char *udid = NULL; + const char *udid = NULL; int use_network = 0; while ((c = getopt_long(argc, argv, "dhu:nv", longopts, NULL)) != -1) { @@ -90,8 +90,7 @@ int main(int argc, char **argv) print_usage(argc, argv, 1); return 2; } - free(udid); - udid = strdup(optarg); + udid = optarg; break; case 'n': use_network = 1; -- cgit v1.1-32-gdbae