X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=inline;f=src%2Fdata%2Fdictionary.c;h=2dd1dfc4641108a08deb9b3e054acb7e872e53da;hb=72f4ef01cee853fd8e5bca96afad06397326ec76;hp=1c50ac7feb26976ea1e9b63d835961a5ae3db243;hpb=503f53bfdde87fc40466dadb77bc04cee0be2567;p=pspp-builds.git diff --git a/src/data/dictionary.c b/src/data/dictionary.c index 1c50ac7f..2dd1dfc4 100644 --- a/src/data/dictionary.c +++ b/src/data/dictionary.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2006, 2007, 2009 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 @@ -78,7 +78,8 @@ struct dictionary void dict_set_encoding (struct dictionary *d, const char *enc) { - d->encoding = strdup (enc); + if (enc) + d->encoding = xstrdup (enc); } const char * @@ -211,7 +212,8 @@ dict_clone (const struct dictionary *s) for (i = 0; i < s->vector_cnt; i++) d->vector[i] = vector_clone (s->vector[i], s, d); - d->encoding = strdup (s->encoding); + if ( s->encoding) + d->encoding = xstrdup (s->encoding); dict_set_attributes (d, dict_get_attributes (s));