aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/support/file.c
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-07-05 21:08:33 -0700
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-07-05 21:08:33 -0700
commit27166a6f65581a9ee820882e5d7506d6bd07ade6 (patch)
tree0e89c5e09a955b2a074a8b34e0f3fe0a4135f346 /src/core/support/file.c
parent4efb6966bdfb62c725c6614b0d85ea374250bb51 (diff)
parentd1dd3a68a2d4af56f1409327c197590dac6968cb (diff)
Merge github.com:grpc/grpc into flow-like-lava-to-a-barnyard
Conflicts: src/core/surface/call.c src/core/transport/chttp2_transport.c src/core/transport/transport.h
Diffstat (limited to 'src/core/support/file.c')
-rw-r--r--src/core/support/file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/support/file.c b/src/core/support/file.c
index 3a4ac6f2f0..c1361d8a9e 100644
--- a/src/core/support/file.c
+++ b/src/core/support/file.c
@@ -38,6 +38,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include "src/core/support/string.h"
@@ -57,7 +58,8 @@ gpr_slice gpr_load_file(const char *filename, int add_null_terminator,
goto end;
}
fseek(file, 0, SEEK_END);
- contents_size = ftell(file);
+ /* Converting to size_t on the assumption that it will not fail */
+ contents_size = (size_t)ftell(file);
fseek(file, 0, SEEK_SET);
contents = gpr_malloc(contents_size + (add_null_terminator ? 1 : 0));
bytes_read = fread(contents, 1, contents_size, file);