commit - 57138e056c5da8bbe30d11e9bc344a8d798b2368
commit + fd86ad6ebc2672118d7b2b5611b55ed2bb279bc2
blob - 1bfbc72ea964232eed667905cbf129cfe460f479
blob + 581695a88de890174ed3deef1c77af9ad991f974
--- libexec/got-index-pack/got-index-pack.c
+++ libexec/got-index-pack/got-index-pack.c
{
char buf[4];
- if(fseek(b, off, 0) == -1)
+ if(fseek(b, off, SEEK_SET) == -1)
return -1;
if(fread(buf, 1, sizeof(buf), b) == -1)
return -1;
{
char buf[8];
- if(fseek(b, off, 0) == -1)
+ if(fseek(b, off, SEEK_SET) == -1)
return -1;
if(fread(buf, 1, sizeof(buf), b) == -1)
return -1;
o->len = ftello(f) - o->off;
if(d == NULL || n != nd)
goto error;
- if(fseek(f, p - r, 0) == -1)
+ if(fseek(f, p - r, SEEK_SET) == -1)
goto error;
if(readpacked(f, &b, flag) == -1)
goto error;
* a bsearch.
*/
idx = -1;
- fseek(f, Hashsz*lo + 8 + 256*4, 0);
+ fseek(f, Hashsz*lo + 8 + 256*4, SEEK_SET);
for(i = 0; i < hi - lo; i++){
if(fread(hh.sha1, 1, sizeof(hh.sha1), f) == -1)
goto err;
if(obj->flag & Cidx){
assert(idx != NULL);
o = ftello(idx);
- if(fseek(idx, obj->off, 0) == -1)
+ if(fseek(idx, obj->off, SEEK_SET) == -1)
errx(1, "could not seek to object offset");
if(readpacked(idx, obj, flag) == -1)
errx(1, "could not reload object");
- if(fseek(idx, o, 0) == -1)
+ if(fseek(idx, o, SEEK_SET) == -1)
errx(1, "could not restore offset");
cache(obj);
return obj;
memcpy(path + n - 4, ".pack", 6);
if((f = fopen(path, "r")) == NULL)
goto error;
- if(fseek(f, o, 0) == -1)
+ if(fseek(f, o, SEEK_SET) == -1)
goto error;
if(readpacked(f, obj, flag) == -1)
goto error;
int n, r;
o->crc = 0;
- fseek(f, o->off, 0);
+ fseek(f, o->off, SEEK_SET);
for(n = o->len; n > 0; n -= r){
r = fread(buf, 1, n > sizeof(buf) ? sizeof(buf) : n, f);
if(r == -1)
objects[i] = o;
}
o = objects[i];
- fseek(f, o->off, 0);
+ fseek(f, o->off, SEEK_SET);
if (readpacked(f, o, Cidx) == 0){
SHA1Init(&objctx);
SHA1Update(&objctx, (uint8_t*)o->all, o->size + strlen(o->all) + 1);