Marek Brunda replied to the topic 'Problem with indi_getprop' in the forum. 4 years ago

I rewrrote the function crackDPE in file getINDIproperty.c and it works. But it's quick and dirty solution for today's observation without knowledge of other connections to anonother parts of code. Analogous changes need to be made in setINDIproperty.c.

/* crack spec and add to srchs[], else exit */
static void crackDPE(char *spec)
{
    char d[1024], p[1024], e[1024];
    char buf[3*1024];
    char *ptr;

    strncpy(buf, spec, 3*1024);
    buf[3*1024-1] = 0;

    if (verbose)
        fprintf(stderr, "looking for %s\n", spec);

    ptr = strrchr(buf, '.');
    if(!ptr) {
       fprintf(stderr, "Unknown format for property spec: %s\n", spec);
       usage();
    }
    *ptr++ = 0;
    strncpy(e, ptr, 1024);
    e[1023] = 0;

    ptr = strrchr(buf, '.');
    if(!ptr) {
       fprintf(stderr, "Unknown format for property spec: %s\n", spec);
       usage();
    }
    *ptr++ = 0;
    strncpy(p, ptr, 1024);
    p[1023] = 0;

    strncpy(d, buf, 1024);
    d[1023] = 0;

    addSearchDef(d, p, e);
}


Read More...