git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
some bugfixes around -z.
[swftools.git]
/
pdf2swf
/
xpdf
/
GString.cc
diff --git
a/pdf2swf/xpdf/GString.cc
b/pdf2swf/xpdf/GString.cc
index
3bf626a
..
7653fd0
100644
(file)
--- a/
pdf2swf/xpdf/GString.cc
+++ b/
pdf2swf/xpdf/GString.cc
@@
-4,15
+4,16
@@
//
// Simple variable-length string type.
//
//
// Simple variable-length string type.
//
-// Copyright 1996-2002 Glyph & Cog, LLC
+// Copyright 1996-2003 Glyph & Cog, LLC
//
//========================================================================
//
//========================================================================
-#ifdef __GNUC__
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
#pragma implementation
#endif
#pragma implementation
#endif
-#include <aconf.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
@@
-203,8
+204,12
@@
GString *GString::del(int i, int n) {
int j;
if (n > 0) {
int j;
if (n > 0) {
- for (j = i; j <= length - n; ++j)
+ if (i + n > length) {
+ n = length - i;
+ }
+ for (j = i; j <= length - n; ++j) {
s[j] = s[j + n];
s[j] = s[j + n];
+ }
resize(length -= n);
}
return this;
resize(length -= n);
}
return this;