/* Function to handle properly a reallocation when saving an URI Also imposes some limit on the length of an URI string output  */
static xmlChar* xmlSaveUriRealloc(xmlChar *ret, int *max)
/* Function to handle properly a reallocation when saving an URI Also imposes some limit on the length of an URI string output  */
static xmlChar* xmlSaveUriRealloc(xmlChar *ret, int *max)
{
        xmlURIErrMemory("reaching arbitrary MAX_URI_LENGTH limit\n");
        return(NULL);
    }
    tmp = *max * 2;
    temp = (xmlChar *) xmlRealloc(ret, (tmp + 1));
    if (temp == NULL) {
        xmlURIErrMemory("saving URI\n");
        return(NULL);
    }
    *max = tmp;
    return(temp);
}