summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@hotmail.com>2010-08-07 17:18:53 +0000
committerSebastian Rasmussen <sebras@hotmail.com>2010-08-07 17:18:53 +0000
commit5237434d1c51a836b6c1faaebe89710196d6af9a (patch)
tree19c0f071178317ff83a6a1dfcdccb71c64100e77
parent2a3efa7d61a7236b803703632ccba50b9d659c0a (diff)
downloadmupdf-5237434d1c51a836b6c1faaebe89710196d6af9a.tar.xz
Fix another bug in pdfinfo.
-rw-r--r--apps/pdfinfo.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/pdfinfo.c b/apps/pdfinfo.c
index 392d0c96..2db4acd9 100644
--- a/apps/pdfinfo.c
+++ b/apps/pdfinfo.c
@@ -731,9 +731,9 @@ printinfo(char *filename, int show, int page)
if (!strncmp(cs, "Device", 6))
{
- for (j = 0; cs[j + 6] != '\0'; j++)
- cs[3 + j] = cs[j + 6];
- cs[3 + j] = '\0';
+ int len = strlen(cs + 6);
+ memmove(cs + 3, cs + 6, len + 1);
+ cs[3 + len + 1] = '\0';
}
if (strstr(cs, "ICC"))
fz_strlcpy(cs, "ICC", 4);
@@ -750,9 +750,9 @@ printinfo(char *filename, int show, int page)
if (!strncmp(altcs, "Device", 6))
{
- for (j = 0; altcs[j + 6] != '\0'; j++)
- altcs[3 + j] = altcs[j + 6];
- altcs[j + 6] = '\0';
+ int len = strlen(altcs + 6);
+ memmove(altcs + 3, altcs + 6, len + 1);
+ altcs[3 + len + 1] = '\0';
}
if (strstr(altcs, "ICC"))
fz_strlcpy(altcs, "ICC", 4);