Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pdf/goo
diff options
context:
space:
mode:
Diffstat (limited to 'pdf/goo')
-rw-r--r--pdf/goo/GString.cc11
-rw-r--r--pdf/goo/GString.h4
2 files changed, 11 insertions, 4 deletions
diff --git a/pdf/goo/GString.cc b/pdf/goo/GString.cc
index 3bf626a..25e0e05 100644
--- a/pdf/goo/GString.cc
+++ b/pdf/goo/GString.cc
@@ -8,11 +8,12 @@
//
//========================================================================
-#ifdef __GNUC__
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
#pragma implementation
#endif
-#include <aconf.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) {
- 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];
+ }
resize(length -= n);
}
return this;
diff --git a/pdf/goo/GString.h b/pdf/goo/GString.h
index 93796cb..d22cc19 100644
--- a/pdf/goo/GString.h
+++ b/pdf/goo/GString.h
@@ -11,7 +11,9 @@
#ifndef GSTRING_H
#define GSTRING_H
-#ifdef __GNUC__
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
#pragma interface
#endif