[poppler] utils/parseargs.cc

Adrian Johnson ajohnson at kemper.freedesktop.org
Sun Jan 15 04:03:06 PST 2012


 utils/parseargs.cc |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 4e205a6625431dcf95375de009b4354746a4f0b7
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Sun Jan 15 22:18:30 2012 +1030

    parseargs: don't use arg->size with GooString argument
    
    40b56994 added GooString arguments but incorrectly used arg->size as
    the string length. arg->size is always 0 for GooString arguments. This
    worked because the arg->size - 1 string length passed to
    GooString::Set() just happened to be the the same value as the
    CALC_STRING_LEN default argument indicating the string length is to be
    calculated with strlen.

diff --git a/utils/parseargs.cc b/utils/parseargs.cc
index ef971a5..922746d 100644
--- a/utils/parseargs.cc
+++ b/utils/parseargs.cc
@@ -156,8 +156,7 @@ static GBool grabArg(const ArgDesc *arg, int i, int *argc, char *argv[]) {
     break;
   case argGooString:
     if (i + 1 < *argc) {
-      ((GooString*)arg->val)->Set(argv[i+1], arg->size - 1);
-      ((GooString*)arg->val)->append('\0');
+      ((GooString*)arg->val)->Set(argv[i+1]);
       n = 2;
     } else {
       ok = gFalse;


More information about the poppler mailing list