(svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL)

This commit is contained in:
rubidium
2014-04-25 15:40:32 +00:00
parent 0b159549d4
commit 034735a54c
70 changed files with 207 additions and 183 deletions

View File

@@ -12,6 +12,7 @@
#include "stdafx.h"
#include "base_consist.h"
#include "vehicle_base.h"
#include "string_func.h"
#include "safeguards.h"
@@ -29,7 +30,7 @@ void BaseConsist::CopyConsistPropertiesFrom(const BaseConsist *src)
if (this == src) return;
free(this->name);
this->name = src->name != NULL ? strdup(src->name) : NULL;
this->name = src->name != NULL ? stredup(src->name) : NULL;
this->current_order_time = src->current_order_time;
this->lateness_counter = src->lateness_counter;