[uim-commit] r3086 - branches/r5rs/sigscheme/src

yamaken at freedesktop.org yamaken at freedesktop.org
Thu Feb 2 10:48:45 PST 2006


Author: yamaken
Date: 2006-02-02 10:48:40 -0800 (Thu, 02 Feb 2006)
New Revision: 3086

Modified:
   branches/r5rs/sigscheme/src/number.c
Log:
* sigscheme/src/number.c
  - Include errno.h
  - (scm_string2number): Add overflow check


Modified: branches/r5rs/sigscheme/src/number.c
===================================================================
--- branches/r5rs/sigscheme/src/number.c	2006-02-02 17:36:30 UTC (rev 3085)
+++ branches/r5rs/sigscheme/src/number.c	2006-02-02 18:48:40 UTC (rev 3086)
@@ -39,6 +39,7 @@
 =======================================*/
 #include <stdlib.h>
 #include <limits.h>
+#include <errno.h>
 
 /*=======================================
   Local Include
@@ -509,6 +510,9 @@
 #error "This platform is not supported"
 #endif
 
+    if (errno == ERANGE || n < SCM_INT_MIN || SCM_INT_MAX < n)
+        ERR("fixnum limit exceeded: %d", n);
+
     empty_strp = (end == str);  /* apply the first rule above */
     *err = (empty_strp || *end);
     return n;



More information about the uim-commit mailing list