summaryrefslogtreecommitdiff
path: root/tools/slang-generate/main.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2017-11-04 18:07:09 -0400
committerYong He <yonghe@outlook.com>2017-11-04 18:07:09 -0400
commitd1009d1a5ac7463dc74169ed7c6e1e692b3541d7 (patch)
treeb21cd74ca6daabd655f5a2625c2698de16a92dd1 /tools/slang-generate/main.cpp
parent1f9686ce87573efdd4ad56040deb2d424fe51929 (diff)
parent784bd914cface6e5837ef0da7aee0df2e16c4999 (diff)
merge with fixWarnings branch
Diffstat (limited to 'tools/slang-generate/main.cpp')
-rw-r--r--tools/slang-generate/main.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/slang-generate/main.cpp b/tools/slang-generate/main.cpp
index eef7d95c7..8208354e4 100644
--- a/tools/slang-generate/main.cpp
+++ b/tools/slang-generate/main.cpp
@@ -4,6 +4,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "../../source/core/secure-crt.h"
struct StringSpan
{
@@ -401,7 +402,8 @@ int main(
// Read the contents o the file and translate it into a "template" file
- FILE* inputStream = fopen(inputPath, "rb");
+ FILE* inputStream;
+ fopen_s(&inputStream, inputPath, "rb");
fseek(inputStream, 0, SEEK_END);
size_t inputSize = ftell(inputStream);
fseek(inputStream, 0, SEEK_SET);
@@ -415,9 +417,10 @@ int main(
Node* node = readInput(input, inputEnd);
char outputPath[1024];
- sprintf(outputPath, "%s.h", inputPath);
+ sprintf_s(outputPath, "%s.h", inputPath);
- FILE* outputStream = fopen(outputPath, "w");
+ FILE* outputStream;
+ fopen_s(&outputStream, outputPath, "w");
emitBody(outputStream, node);