X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Foptions.c;h=be2bed42d98ecfd8f4040f81e0f912e4b3a3fec6;hb=e0701896ff3fcdc18a26ca1881d8c657833dad77;hp=b8921255d3b08e59b592021b7a025f59f7af1e38;hpb=fce028c380d496e42823fd24774e0159ed7cc110;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;