diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2009-07-27 07:26:29 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2009-07-27 07:26:29 +0000 |
commit | 0f2960b934725b88f901e88503a32aca3c2242d7 (patch) | |
tree | 12294820574451fc42a242866e78f0d6ba9e1ba9 /navit/vehicleprofile.c | |
parent | be66d55df7cfedd2542c89a23f4b13c7e862b0c9 (diff) | |
download | navit-0f2960b934725b88f901e88503a32aca3c2242d7.tar.gz |
Fix:Core:Fixed win32 build
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@2410 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/vehicleprofile.c')
-rw-r--r-- | navit/vehicleprofile.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/navit/vehicleprofile.c b/navit/vehicleprofile.c index 9b2ae2a8b..e887200ad 100644 --- a/navit/vehicleprofile.c +++ b/navit/vehicleprofile.c @@ -45,14 +45,12 @@ vehicleprofile_set_attr_do(struct vehicleprofile *this_, struct attr *attr) case attr_route_mode: this_->mode=attr->u.num; break; - case attr_name: - if(this_->name) free(this_->name); - - // Only copy the first 1024 characters. Should be enough for - // normal use, but still prevent ludicrous memory allocations - // in case of a bug somewhere. - this_->name = strndup(attr->u.str, 2); - break; + case attr_name: + if(this_->name) + g_free(this_->name); + /* previously used strdupn not available on win32 */ + this_->name = g_strdup(attr->u.str); + break; default: break; } |