updater: Fix the broken ReadFileFn.
Was accidentally broken by the CL in [1]. [1]: commitd6c93afcc2Bug: 29767315 Change-Id: I851e13ccea6f5be6fcd47f712cc95867245f9934 (cherry picked from commitefacd80364)
This commit is contained in:
+1
-1
@@ -1417,7 +1417,7 @@ Value* ReadFileFn(const char* name, State* state, int argc, Expr* argv[]) {
|
|||||||
v->data = nullptr;
|
v->data = nullptr;
|
||||||
|
|
||||||
FileContents fc;
|
FileContents fc;
|
||||||
if (LoadFileContents(filename, &fc) != 0) {
|
if (LoadFileContents(filename, &fc) == 0) {
|
||||||
v->data = static_cast<char*>(malloc(fc.data.size()));
|
v->data = static_cast<char*>(malloc(fc.data.size()));
|
||||||
if (v->data != nullptr) {
|
if (v->data != nullptr) {
|
||||||
memcpy(v->data, fc.data.data(), fc.data.size());
|
memcpy(v->data, fc.data.data(), fc.data.size());
|
||||||
|
|||||||
Reference in New Issue
Block a user