(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

@@ -77,7 +77,7 @@ ErrorMessageData::ErrorMessageData(const ErrorMessageData &data)
*this = data;
for (size_t i = 0; i < lengthof(this->strings); i++) {
if (this->strings[i] != NULL) {
this->strings[i] = strdup(this->strings[i]);
this->strings[i] = stredup(this->strings[i]);
this->decode_params[i] = (size_t)this->strings[i];
}
}
@@ -158,7 +158,7 @@ void ErrorMessageData::SetDParam(uint n, uint64 v)
void ErrorMessageData::SetDParamStr(uint n, const char *str)
{
free(this->strings[n]);
this->strings[n] = strdup(str);
this->strings[n] = stredup(str);
}
/** Define a queue with errors. */