diff options
| author | 2012-11-29 03:42:06 +0100 | |
|---|---|---|
| committer | 2012-11-29 03:42:06 +0100 | |
| commit | 36c0192fbb16d068214d2640aecfb731ea24bfaa (patch) | |
| tree | 4596eb003c5f074c4ca0b9e1e146680927916d11 /tools/ideviceenterrecovery.c | |
| parent | d2b82f9a8330a995a3e913adf734ac2b9ece9916 (diff) | |
| download | libimobiledevice-36c0192fbb16d068214d2640aecfb731ea24bfaa.tar.gz libimobiledevice-36c0192fbb16d068214d2640aecfb731ea24bfaa.tar.bz2 | |
tools: use pointer instead of static buffer for UDID since it can start with '0'
Diffstat (limited to 'tools/ideviceenterrecovery.c')
| -rw-r--r-- | tools/ideviceenterrecovery.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/ideviceenterrecovery.c b/tools/ideviceenterrecovery.c index fc46e75..62df70f 100644 --- a/tools/ideviceenterrecovery.c +++ b/tools/ideviceenterrecovery.c | |||
| @@ -45,8 +45,7 @@ int main(int argc, char *argv[]) | |||
| 45 | idevice_t phone = NULL; | 45 | idevice_t phone = NULL; |
| 46 | idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; | 46 | idevice_error_t ret = IDEVICE_E_UNKNOWN_ERROR; |
| 47 | int i; | 47 | int i; |
| 48 | char udid[41]; | 48 | const char* udid = NULL; |
| 49 | udid[0] = 0; | ||
| 50 | 49 | ||
| 51 | /* parse cmdline args */ | 50 | /* parse cmdline args */ |
| 52 | for (i = 1; i < argc; i++) { | 51 | for (i = 1; i < argc; i++) { |
| @@ -65,7 +64,7 @@ int main(int argc, char *argv[]) | |||
| 65 | print_usage(argc, argv); | 64 | print_usage(argc, argv); |
| 66 | return 0; | 65 | return 0; |
| 67 | } | 66 | } |
| 68 | strcpy(udid, argv[i]); | 67 | udid = argv[i]; |
| 69 | 68 | ||
| 70 | ret = idevice_new(&phone, udid); | 69 | ret = idevice_new(&phone, udid); |
| 71 | if (ret != IDEVICE_E_SUCCESS) { | 70 | if (ret != IDEVICE_E_SUCCESS) { |
