/* 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;
    uLong uReadThis;
    if (file == NULL)
        return UNZ_PARAMERROR;
    s = (unz_s*)file;
    uReadThis = uSizeBuf;
    if (uReadThis > s->gi.size_comment)
        uReadThis = s->gi.size_comment;
    if (ZSEEK(s->z_filefunc, s->filestream, s->central_pos + 22, ZLIB_FILEFUNC_SEEK_SET) != 0)
        return UNZ_ERRNO;
    if (uReadThis > 0) {
        *szComment = '\0';
        if (ZREAD(s->z_filefunc, s->filestream, szComment, uReadThis) != uReadThis)
            return UNZ_ERRNO;
    }
    if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment))
        *(szComment + s->gi.size_comment) = '\0';
    return (int)uReadThis;
}