(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 4227f495c5
commit 9ed12b0f07
70 changed files with 207 additions and 183 deletions

View File

@@ -247,7 +247,7 @@ struct FileWriter {
*/
FileWriter(const char *filename)
{
this->filename = strdup(filename);
this->filename = stredup(filename);
this->fh = fopen(this->filename, "wb");
if (this->fh == NULL) {
@@ -285,7 +285,7 @@ struct HeaderFileWriter : HeaderWriter, FileWriter {
* @param filename The file to open.
*/
HeaderFileWriter(const char *filename) : FileWriter("tmp.xxx"),
real_filename(strdup(filename)), prev(0)
real_filename(stredup(filename)), prev(0)
{
fprintf(this->fh, "/* This file is automatically generated. Do not modify */\n\n");
fprintf(this->fh, "#ifndef TABLE_STRINGS_H\n");