return -1;
}
if(*ptr++ == 0) {
+ char *cptr, tmp[20];
+ float weight;
+ int j;
*count = (*ptr < maxhits) ? *ptr : maxhits;
ptr++;
if(NULL != (*childIDs = emalloc(*count * sizeof(hw_objectID)))) {
if(NULL != (*weights = emalloc(*count * sizeof(float)))) {
ptr2 = *weights;
for(i=0; i<*count; i++) {
- ptr1[i] = *ptr++;
- ptr2[i] = (float) *ptr++;
+ ptr1[i] = *ptr++; /* Object id */
+ cptr = (char *) ptr;
+ j = 0;
+ while(*cptr != ' ') {
+ tmp[j++] = *cptr++;
+ }
+ cptr++; /* Skip space after weight */
+ tmp[j] = '\0';
+ sscanf(tmp, "%f", &weight);
+ ptr2[i] = weight;
+ ptr = (int *) cptr;
+ ptr++; /* Skip 0-Integer after weight string */
}
efree(retmsg->buf);
efree(retmsg);
return -4;
}
if(*ptr++ == 0) {
+ char *cptr, tmp[20];
+ float weight;
+ int j;
*count = (*ptr < maxhits) ? *ptr : maxhits;
ptr++;
if(NULL != (childIDs = emalloc(*count * sizeof(hw_objectID)))) {
if(NULL != (*weights = emalloc(*count * sizeof(float)))) {
ptr2 = *weights;
for(i=0; i<*count; i++) {
- ptr1[i] = *ptr++;
- ptr2[i] = (float) *ptr++;
+ ptr1[i] = *ptr++; /* Object id */
+ cptr = (char *) ptr;
+ j = 0;
+ while(*cptr != ' ') {
+ tmp[j++] = *cptr++;
+ }
+ cptr++; /* Skip space after weight */
+ tmp[j] = '\0';
+ sscanf(tmp, "%f", &weight);
+ ptr2[i] = weight;
+ ptr = (int *) cptr;
+ ptr++; /* Skip 0-Integer after weight string */
}
efree(retmsg->buf);
efree(retmsg);
return -1;
}
if(*ptr++ == 0) {
+ char *cptr, tmp[20];
+ float weight;
+ int j;
*count = (*ptr < maxhits) ? *ptr : maxhits;
ptr++;
if(NULL != (*childIDs = emalloc(*count * sizeof(hw_objectID)))) {
if(NULL != (*weights = emalloc(*count * sizeof(float)))) {
ptr2 = *weights;
for(i=0; i<*count; i++) {
- ptr1[i] = *ptr++;
- ptr2[i] = (float) *ptr++;
+ ptr1[i] = *ptr++; /* Object id */
+ cptr = (char *) ptr;
+ j = 0;
+ while(*cptr != ' ') {
+ tmp[j++] = *cptr++;
+ }
+ cptr++; /* Skip space after weight */
+ tmp[j] = '\0';
+ sscanf(tmp, "%f", &weight);
+ ptr2[i] = weight;
+ ptr = (int *) cptr;
+ ptr++; /* Skip 0-Integer after weight string */
}
} else {
efree(*childIDs);
return -1;
}
if(*ptr++ == 0) {
+ char *cptr, tmp[20];
+ float weight;
+ int j;
*count = (*ptr < maxhits) ? *ptr : maxhits;
ptr++;
if(NULL != (childIDs = emalloc(*count * sizeof(hw_objectID)))) {
if(NULL != (*weights = emalloc(*count * sizeof(float)))) {
ptr2 = *weights;
for(i=0; i<*count; i++) {
- ptr1[i] = *ptr++;
- ptr2[i] = (float) *ptr++;
+ ptr1[i] = *ptr++; /* Object id */
+ cptr = (char *) ptr;
+ j = 0;
+ while(*cptr != ' ') {
+ tmp[j++] = *cptr++;
+ }
+ cptr++; /* Skip space after weight */
+ tmp[j] = '\0';
+ sscanf(tmp, "%f", &weight);
+ ptr2[i] = weight;
+ ptr = (int *) cptr;
+ ptr++; /* Skip 0-Integer after weight string */
}
efree(retmsg->buf);
efree(retmsg);