/* 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  */
int ZEXPORT unzGetGlobalComment(unzFile file, char *szComment, uLong uSizeBuf)
/* 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  */
int ZEXPORT unzGetGlobalComment(unzFile file, char *szComment, uLong uSizeBuf)
{
	unz_s* s;
    ZIPFILE *pzf;
	uLong uReadThis ;
	if (file==NULL)
		return UNZ_PARAMERROR;
	s=(unz_s*)file;
    pzf = s->zfile;
	uReadThis = uSizeBuf;
	if (uReadThis>s->gi.size_comment)
		uReadThis = s->gi.size_comment;
    (*pzf->pfnSeek)(pzf, (int32_t)(s->central_pos+22),SEEK_SET);
	if (uReadThis>0)
    {
      *szComment='\0';
	  if ((*pzf->pfnRead)(pzf, (uint8_t *)szComment,(uint32_t)uReadThis)!=uReadThis)
		return UNZ_ERRNO;
    }
	if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment))
		*(szComment+s->gi.size_comment)='\0';
	return (int)uReadThis;
}