line |
true |
false |
branch |
13
|
1291 |
0 |
FILE* fh = fopen(spath, "rb"); |
14
|
50 |
1241 |
if (fh == NULL) return string(); |
16
|
0 |
1241 |
if (fseek(fh, 0, SEEK_END) != 0) { |
17
|
0 |
0 |
fclose(fh); |
21
|
1241 |
0 |
auto size = ftell(fh); |
22
|
0 |
1241 |
if (size < 0) { |
23
|
0 |
0 |
fclose(fh); |
27
|
1241 |
0 |
rewind(fh); |
28
|
1241 |
0 |
string ret(size); |
29
|
1241 |
0 |
size_t readsize = fread(ret.buf(), sizeof(char), size, fh); |
|
1241 |
0 |
size_t readsize = fread(ret.buf(), sizeof(char), size, fh); |
30
|
0 |
1241 |
if (readsize != (size_t)size) return string(); |
32
|
1241 |
0 |
fclose(fh); |
34
|
1241 |
0 |
return ret; |
37
|
18 |
0 |
}} |
|
18 |
0 |
}} |