[poppler] Branch 'poppler-0.18' - utils/parseargs.cc

Adrian Johnson ajohnson at kemper.freedesktop.org
Sun Jan 15 05:58:39 PST 2012


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

New commits:
commit bd1ed2ea35a653e20f45eebe3dff9ecf98ba4674
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.
    (cherry picked from commit 4e205a6625431dcf95375de009b4354746a4f0b7)

diff --git a/utils/parseargs.cc b/utils/parseargs.cc
index 173fb1e..52c7f0c 100644
--- a/utils/parseargs.cc
+++ b/utils/parseargs.cc
@@ -157,8 +157,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