X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Foptions.c;h=be2bed42d98ecfd8f4040f81e0f912e4b3a3fec6;hb=88f5e7308328d00b3414f34f4313e1a489df2701;hp=b8921255d3b08e59b592021b7a025f59f7af1e38;hpb=35fab6526c3b8491a05769cb72e24c00316c5d3f;p=pspp diff --git a/src/output/options.c b/src/output/options.c index b8921255d3..be2bed42d9 100644 --- a/src/output/options.c +++ b/src/output/options.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2009, 2010, 2014 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -48,7 +48,7 @@ driver_option_create (const char *driver_name, const char *name, o->driver_name = xstrdup (driver_name); o->name = xstrdup (name); o->value = value != NULL ? xstrdup (value) : NULL; - o->default_value = xstrdup (default_value); + o->default_value = default_value ? xstrdup (default_value) : NULL; return o; } @@ -261,9 +261,9 @@ parse_dimension (struct driver_option *o) { int retval; - retval = o->value != NULL ? measure_dimension (o->value) : -1; - if (retval == -1) - retval = measure_dimension (o->default_value); + retval = (o->value != NULL ? measure_dimension (o->value) + : o->default_value != NULL ? measure_dimension (o->default_value) + : -1); driver_option_destroy (o); return retval;