Back to index

php5  5.3.10
Functions
zip_set_archive_comment.c File Reference
#include <stdlib.h>
#include "zipint.h"

Go to the source code of this file.

Functions

 zip_set_archive_comment (struct zip *za, const char *comment, int len)

Function Documentation

zip_set_archive_comment ( struct zip za,
const char *  comment,
int  len 
)

Definition at line 43 of file zip_set_archive_comment.c.

{
    char *tmpcom;

    if (len < 0 || len > MAXCOMLEN
       || (len > 0 && comment == NULL)) {
       _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
       return -1;
    }

    if (len > 0) {
       if ((tmpcom=(char *)_zip_memdup(comment, len, &za->error)) == NULL)
           return -1;
    }
    else
       tmpcom = NULL;

    free(za->ch_comment);
    za->ch_comment = tmpcom;
    za->ch_comment_len = len;
    
    return 0;
}

Here is the call graph for this function: