Commit 35b99552 authored by Lubomir Bulej's avatar Lubomir Bulej

Cleanup get_filesize()

Check the result of stat() to make sure we return reasonable value.
parent 9ff22be1
......@@ -68,8 +68,8 @@ struct inst_jar {
static long
get_filesize(const char * filename) {
struct stat buffer;
int status;
status = stat(filename, &buffer);
int result = stat(filename, &buffer);
check_std_error (result != 0, "failed to determine size of %s", filename);
return (buffer.st_size);
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