/*
- * "$Id: string.c 5368 2006-04-02 19:23:50Z mike $"
+ * "$Id: string.c 6188 2007-01-10 16:23:06Z mike $"
*
* String functions for the Common UNIX Printing System (CUPS).
*
- * Copyright 1997-2006 by Easy Software Products.
+ * Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
if (loc && loc->decimal_point)
{
dec = loc->decimal_point;
- declen = strlen(dec);
+ declen = (int)strlen(dec);
}
else
{
}
}
+ if (*buf == 'e' || *buf == 'E')
+ {
+ /*
+ * Read exponent...
+ */
+
+ if (tempptr < (temp + sizeof(temp) - 1))
+ *tempptr++ = *buf++;
+ else
+ {
+ if (bufptr)
+ *bufptr = NULL;
+
+ return (0.0);
+ }
+
+ if (*buf == '+' || *buf == '-')
+ {
+ if (tempptr < (temp + sizeof(temp) - 1))
+ *tempptr++ = *buf++;
+ else
+ {
+ if (bufptr)
+ *bufptr = NULL;
+
+ return (0.0);
+ }
+ }
+
+ while (isdigit(*buf & 255))
+ if (tempptr < (temp + sizeof(temp) - 1))
+ *tempptr++ = *buf++;
+ else
+ {
+ if (bufptr)
+ *bufptr = NULL;
+
+ return (0.0);
+ }
+ }
+
/*
* Nul-terminate the temporary string and return the value...
*/
/*
- * End of "$Id: string.c 5368 2006-04-02 19:23:50Z mike $".
+ * End of "$Id: string.c 6188 2007-01-10 16:23:06Z mike $".
*/