MCPcopy Create free account
hub / github.com/Squirrel/Squirrel.Windows / unzGetGlobalComment

Function unzGetGlobalComment

src/Setup/unzip.cpp:3696–3711  ·  view source on GitHub ↗

Get the global comment string of the ZipFile, in the szComment buffer. uSizeBuf is the size of the szComment buffer. return the number of byte copied or an error code <0

Source from the content-addressed store, hash-verified

3694// uSizeBuf is the size of the szComment buffer.
3695// return the number of byte copied or an error code <0
3696int unzGetGlobalComment (unzFile file, char *szComment, uLong uSizeBuf)
3697{ //int err=UNZ_OK;
3698 unz_s* s;
3699 uLong uReadThis ;
3700 if (file==NULL) return UNZ_PARAMERROR;
3701 s=(unz_s*)file;
3702 uReadThis = uSizeBuf;
3703 if (uReadThis>s->gi.size_comment) uReadThis = s->gi.size_comment;
3704 if (lufseek(s->file,s->central_pos+22,SEEK_SET)!=0) return UNZ_ERRNO;
3705 if (uReadThis>0)
3706 { *szComment='\0';
3707 if (lufread(szComment,(uInt)uReadThis,1,s->file)!=1) return UNZ_ERRNO;
3708 }
3709 if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment)) *(szComment+s->gi.size_comment)='\0';
3710 return (int)uReadThis;
3711}
3712
3713
3714

Callers

nothing calls this directly

Calls 2

lufseekFunction · 0.85
lufreadFunction · 0.85

Tested by

no test coverage detected