Commit 4e205a66 authored by Adrian Johnson's avatar Adrian Johnson
Browse files

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.
parent a7210a7e
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment