Opened 16 years ago

Closed 16 years ago

#2394 closed defect (fixed)

error when binding attributes stored in scientific notation to integer attributes

Reported by: tbonfort Owned by: tbonfort
Priority: normal Milestone:
Component: MapServer C Library Version: unspecified
Severity: normal Keywords:
Cc:

Description

in maputil.c :

static int bindIntegerAttribute(int *attribute, char *value)
{
  if(!value || strlen(value) == 0) return MS_FAILURE;
  *attribute = atoi(value);
  return MS_SUCCESS;
}

when value is a string in scientific notation, for example "7.456e+003" , atoi converts it to the value 7 instead of 7456

Change History (1)

comment:1 by tbonfort, 16 years ago

Resolution: fixed
Status: newclosed

fixed in r7029 by using

*attribute = MS_NINT(atof(value));
Note: See TracTickets for help on using tickets.