Commit 67662294 by Aaron Leung

Adding reminders regarding error handling.

parent 6c012583
...@@ -8,14 +8,12 @@ namespace Sass { ...@@ -8,14 +8,12 @@ namespace Sass {
path = _path; path = _path;
if (!_source) { if (!_source) {
std::FILE *f; std::FILE *f;
// TO DO: CHECK f AGAINST NULL/0
f = std::fopen(path, "rb"); f = std::fopen(path, "rb");
// if (!f) {
// printf("ERROR: could not open file %s", path);
// abort();
// }
std::fseek(f, 0, SEEK_END); std::fseek(f, 0, SEEK_END);
int len = std::ftell(f); int len = std::ftell(f);
std::rewind(f); std::rewind(f);
// TO DO: WRAP THE new[] IN A TRY/CATCH BLOCK
source = new char[len + 1]; source = new char[len + 1];
std::fread(source, sizeof(char), len, f); std::fread(source, sizeof(char), len, f);
source[len] = '\0'; source[len] = '\0';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment