projects
/
henge
/
apc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6f8c57f
)
ston_ht32_fwrite
author
ken
<ken@mihrtec.com>
Wed, 8 Mar 2017 01:01:32 +0000
(17:01 -0800)
committer
ken
<ken@mihrtec.com>
Wed, 8 Mar 2017 01:01:32 +0000
(17:01 -0800)
implemented, bugs fixed
ston/ston_ht.h
patch
|
blob
|
history
diff --git
a/ston/ston_ht.h
b/ston/ston_ht.h
index
5063431
..
4cddc78
100644
(file)
--- a/
ston/ston_ht.h
+++ b/
ston/ston_ht.h
@@
-195,8
+195,10
@@
size_t ston_ht32_fwrite
{ size_t bytes_written;
long fpos_start;
if ((fpos_start = ftell(file)) == NULL
{ size_t bytes_written;
long fpos_start;
if ((fpos_start = ftell(file)) == NULL
+ || fseek(file, fpos, SEEK_SET) == 0
|| (bytes_written = fwrite(file, 1, sizeof(ston_ht_h), file)) < sizeof(ston_ht_h)
|| (bytes_written = fwrite(file, 1, sizeof(ston_ht_h), file)) < sizeof(ston_ht_h)
- || (bytes_written += fwrite(file, 1, ston_ht32_bytes(ht), file)) < (sizeof(ston_ht_h) + ston_ht32_bytes(ht)))
+ || (bytes_written += fwrite(file, 1, ston_ht32_bytes(ht), file)) < (sizeof(ston_ht_h) + ston_ht32_bytes(ht))
+ || fseek(file, fpos_start, SEEK_SET) == 0)
return 0;
return bytes_written;
}
return 0;
return bytes_written;
}