From acecac3cb8b66fddd9dc811c920c6b7dfb969895 Mon Sep 17 00:00:00 2001 From: tihmstar Date: Wed, 15 Nov 2023 00:45:53 +0100 Subject: Change path_get_basename()'s return type to const char* This makes it clear that the return value is immutable and moreover suggests that the return vale is not allocated and thus should be treated carefully. --- src/idevicerestore.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/idevicerestore.c') diff --git a/src/idevicerestore.c b/src/idevicerestore.c index 9bc9f8b..064c503 100644 --- a/src/idevicerestore.c +++ b/src/idevicerestore.c @@ -987,8 +987,7 @@ int idevicerestore_start(struct idevicerestore_client_t* client) if (stat(client->cache_dir, &st) < 0) { mkdir_with_parents(client->cache_dir, 0755); } - char* ipsw_basename = path_get_basename(client->ipsw->path); - ipsw_basename = strdup(ipsw_basename); + char* ipsw_basename = strdup(path_get_basename(client->ipsw->path)); char* p = strrchr(ipsw_basename, '.'); if (p && isalpha(*(p+1))) { *p = '\0'; -- cgit v1.1-32-gdbae