diff options
author | yexo <yexo@openttd.org> | 2010-01-15 18:28:30 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-01-15 18:28:30 +0000 |
commit | bd102b78eef2c7d72f83af1ed214ba1afe3cea17 (patch) | |
tree | fc681bed82c6d98ba05276a938933f559ab44091 /src/newgrf_gui.cpp | |
parent | aaf0b4b46ca2745bb12dad5c228c23446c3203ec (diff) | |
download | openttd-bd102b78eef2c7d72f83af1ed214ba1afe3cea17.tar.xz |
(svn r18813) -Codechange: deduplicate copying a newgrf config
Diffstat (limited to 'src/newgrf_gui.cpp')
-rw-r--r-- | src/newgrf_gui.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index f87f7bc93..bf942dff3 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -381,12 +381,7 @@ public: } /* Copy GRF details from scanned list */ - GRFConfig *c = CallocT<GRFConfig>(1); - *c = *src; - c->filename = strdup(src->filename); - if (src->name != NULL) c->name = strdup(src->name); - if (src->info != NULL) c->info = strdup(src->info); - c->next = NULL; + GRFConfig *c = DuplicateGRFConfig(src); /* Append GRF config to configuration list */ *list = c; |