(svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL)
This commit is contained in:
@@ -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");
|
||||
|
Reference in New Issue
Block a user