[Image-SIG] AccessInit: hash collision: 3 for both 1 and 1

Bill Janssen janssen at parc.com
Mon Apr 5 04:41:41 CEST 2010


Seems to me that in libImaging, Access.c:add_item should really read

static ImagingAccess
add_item(const char* mode)
{
    UINT32 i = hash(mode);
    /* printf("hash %s => %d\n", mode, i); */
    if (access_table[i].mode && (strcmp(mode, access_table[i].mode) != 0)) {
        fprintf(stderr, "AccessInit: hash collision: %d for both %s and %s\n",
                i, mode, access_table[i].mode);
        exit(1);
    }
    access_table[i].mode = mode;
    return &access_table[i];
}

Currently, it reads:

static ImagingAccess
add_item(const char* mode)
{
    UINT32 i = hash(mode);
    /* printf("hash %s => %d\n", mode, i); */
    if (access_table[i].mode) {
        fprintf(stderr, "AccessInit: hash collision: %d for both %s and %s\n",
                i, mode, access_table[i].mode);
        exit(1);
    }
    access_table[i].mode = mode;
    return &access_table[i];
}

And there's a number of Google hits for "AccessInit: hash collision: 3
for both 1 and 1", starting about the release of 1.1.7.

Bill


More information about the Image-SIG mailing list