summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdk-stage1/url.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/mdk-stage1/url.c b/mdk-stage1/url.c
index 90bb43139..bbfff8464 100644
--- a/mdk-stage1/url.c
+++ b/mdk-stage1/url.c
@@ -336,12 +336,7 @@ static int ftp_get_filesize(int sock, char * remotename)
int i;
strcpy(buf, remotename);
- ptr = buf;
- while (*ptr)
- ptr++;
- ptr--;
- while (*ptr && *ptr != '/')
- ptr--;
+ ptr = strrchr(buf, '/');
if (!*ptr)
return -1;
*ptr = '\0';