[rtmpdump] r125 - trunk/swfvfy.c
hyc
subversion at mplayerhq.hu
Tue Dec 29 09:07:10 CET 2009
Author: hyc
Date: Tue Dec 29 09:07:09 2009
New Revision: 125
Log:
Strip trailing params from swfurl in saved copy
Modified:
trunk/swfvfy.c
Modified: trunk/swfvfy.c
==============================================================================
--- trunk/swfvfy.c Tue Dec 29 00:23:32 2009 (r124)
+++ trunk/swfvfy.c Tue Dec 29 09:07:09 2009 (r125)
@@ -144,8 +144,9 @@ SWFVerify(const char *url, unsigned int
if (strncmp(buf, "url: ", 5))
continue;
r1 = strrchr(buf, '/');
- buf[strlen(buf)-1] = '\0';
- if (strcmp(r1, file))
+ i = strlen(r1);
+ r1[--i] = '\0';
+ if (strncmp(r1, file, i))
continue;
pos = ftell(f);
while (got < 3 && fgets(buf, sizeof(buf), f))
@@ -207,10 +208,17 @@ SWFVerify(const char *url, unsigned int
fseek(f, pos, SEEK_SET);
else
{
+ char *q;
if (!f)
f = fopen(path, "w");
fseek(f, 0, SEEK_END);
- fprintf(f, "url: %s\n", url);
+ q = strchr(url, '?');
+ if (q)
+ i = q - url;
+ else
+ i = strlen(url);
+
+ fprintf(f, "url: %.*s\n", i, url);
}
fprintf(f, "date: %s\n", date);
fprintf(f, "size: %08x\n", in.size);
More information about the rtmpdump
mailing list