diff options
author | Sebastian Rasmussen <sebras@hotmail.com> | 2010-08-07 17:18:53 +0000 |
---|---|---|
committer | Sebastian Rasmussen <sebras@hotmail.com> | 2010-08-07 17:18:53 +0000 |
commit | 5237434d1c51a836b6c1faaebe89710196d6af9a (patch) | |
tree | 19c0f071178317ff83a6a1dfcdccb71c64100e77 /apps | |
parent | 2a3efa7d61a7236b803703632ccba50b9d659c0a (diff) | |
download | mupdf-5237434d1c51a836b6c1faaebe89710196d6af9a.tar.xz |
Fix another bug in pdfinfo.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/pdfinfo.c | 12 |
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); |