git://git.novaco.in
/
novacoin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(from parent 1:
19f5fc8
)
Merge pull request #343 from svost/c++11
author
CryptoManiac
<CryptoManiac@users.noreply.github.com>
Wed, 4 May 2016 15:43:56 +0000 (19:43 +0400)
committer
CryptoManiac
<CryptoManiac@users.noreply.github.com>
Wed, 4 May 2016 15:43:56 +0000 (19:43 +0400)
Minor fix: c++11 branch
src/util.cpp
patch
|
blob
|
history
diff --git
a/src/util.cpp
b/src/util.cpp
index
744717c
..
1500e0f
100644
(file)
--- a/
src/util.cpp
+++ b/
src/util.cpp
@@
-1246,8
+1246,9
@@
void ShrinkDebugFile()
// Restart the file with some of the end
try {
vector<char>* vBuf = new vector <char>(200000, 0);
- fseek(file, -((long)(vBuf->size())), SEEK_END);
- size_t nBytes = fread(&vBuf->operator[](0), 1, vBuf->size(), file);
+ size_t nBytes = 1; //write one byte if fseek failed
+ if (fseek(file, -((long)(vBuf->size())), SEEK_END) == 0)
+ nBytes = fread(&vBuf->operator[](0), 1, vBuf->size(), file);
fclose(file);
file = fopen(pathLog.string().c_str(), "w");
if (file)