- pidList = xmalloc(sizeof(long));
- while ((p = procps_scan(0)) != 0)
- {
- if (strncmp(p->short_cmd, pidName, COMM_LEN-1) == 0) {
- pidList=xrealloc( pidList, sizeof(long) * (i+2));
- pidList[i++]=p->pid;
+ pidList = xmalloc(sizeof(*pidList));
+ while ((p = procps_scan(0)) != 0) {
+ if (strncmp(p->short_cmd, procName, COMM_LEN-1) == 0) {
+ pidList = xrealloc(pidList, sizeof(*pidList) * (i+2));
+ pidList[i++] = p->pid;