EXEC SQL BEGIN DECLARE SECTION;
int ngid;
EXEC SQL END DECLARE SECTION;
- char *malloc();
unsigned char *p;
int idx;
value = htonl(value);
}
value = htonl(value);
- argv[9+row] = strsave(inet_ntoa(value));
+ strcpy(argv[9+row], inet_ntoa(value));
} else {
- argv[9+row] = strsave("unassigned");
+ strcpy(argv[9+row], "unassigned");
}
/* status checking */
return(MR_PERM);
}
+ /*
+ * If this is an update_host query, we're done.
+ */
+ if (row == 1)
+ return(MR_SUCCESS);
+
+ /*
+ * For an add_host query, allocate and fill in a new machine id,
+ * and then insert the creator id.
+ */
if ((mr_errcode = prefetch_value(q,argv,cl)) != MR_SUCCESS)
return(mr_errcode);
- row = q->argc + q->vcnt + 1;
- sprintf(buf, "%d",cl->client_id);
- argv[row] = strsave(buf);
- argv[row+1] = NULL;
+ sprintf(argv[q->argc + q->vcnt + 1], "%d",cl->client_id);
return(MR_SUCCESS);
}