git.asbjorn.biz
/
swftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b297c77
)
made getstring respect the tag boundary
author
kramm
<kramm>
Wed, 17 Jan 2007 13:33:28 +0000
(13:33 +0000)
committer
kramm
<kramm>
Wed, 17 Jan 2007 13:33:28 +0000
(13:33 +0000)
lib/rfxswf.c
patch
|
blob
|
history
diff --git
a/lib/rfxswf.c
b/lib/rfxswf.c
index
b986c83
..
ad3ad21
100644
(file)
--- a/
lib/rfxswf.c
+++ b/
lib/rfxswf.c
@@
-83,7
+83,16
@@
void swf_SetTagPos(TAG * t,U32 pos)
char* swf_GetString(TAG*t)
{
char* str = ((char*)(&(t)->data[(t)->pos]));
char* swf_GetString(TAG*t)
{
char* str = ((char*)(&(t)->data[(t)->pos]));
- while(swf_GetU8(t));
+ while(t->pos < t->len && swf_GetU8(t));
+ /* make sure we always have a trailing zero byte */
+ if(t->pos == t->len) {
+ if(t->len == t->memsize) {
+ swf_ResetWriteBits(t);
+ swf_SetU8(t, 0);
+ t->len = t->pos;
+ }
+ t->data[t->len] = 0;
+ }
return str;
}
return str;
}