mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-12 09:09:09 +00:00
(svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL)
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user