rem: if(*endp) return -1;
add: if(*endp || endp==name) return -1;
context: int signal_name_to_number(char *name){  const mapstruct *ptr;  mapstruct ms;  long val;  char *endp;  int offset;  /* clean up name */  if(!strncasecmp(name,"SIG",3)) name += 3;  if(!strcasecmp(name,"CLD")) return SIGCHLD;  if(!strcasecmp(name,"IO"))  return SIGPOLL;  if(!strcasecmp(name,"IOT")) return SIGABRT;  /* search the table */  ms.name = name;  ptr = bsearch(&ms, sigtable, number_of_signals,     sizeof(mapstruct), compare_signal_names  );  if(ptr) return ptr->num;  if(!strcasecmp(name,"RTMIN")) return SIGRTMIN;  if(!strcasecmp(name,"EXIT"))  return 0;  if(!strcasecmp(name,"NULL"))  return 0;  offset = 0;  if(!strncasecmp(name,"RTMIN+",6)){    name += 6;    offset = SIGRTMIN;  }  /* not found, so try as a number */  val = strtol(name,&endp,10);  if(*endp) return -1; /* not valid */  if(val+SIGRTMIN>127) return -1; /* not valid */  return val+offset;}