* chars.c (scm_integer_to_char): Use Greg's nice
authorMikael Djurfeldt <djurfeldt@nada.kth.se>
Thu, 6 Jan 2000 22:13:25 +0000 (22:13 +0000)
committerMikael Djurfeldt <djurfeldt@nada.kth.se>
Thu, 6 Jan 2000 22:13:25 +0000 (22:13 +0000)
SCM_VALIDATE_INUM_RANGE macro for argument checking for closer
adherence to R5RS.

libguile/chars.c

index 57859f4..0c04e1d 100644 (file)
@@ -265,8 +265,8 @@ SCM_DEFINE (scm_integer_to_char, "integer->char", 1, 0, 0,
 "Return the character at position N in the Ascii sequence.")
 #define FUNC_NAME s_scm_integer_to_char
 {
-  unsigned long ni = 0xffff & SCM_NUM2ULONG (1,n);
-  return SCM_MAKICHR(ni);
+  SCM_VALIDATE_INUM_RANGE (1, n, 0, 256);
+  return SCM_MAKICHR (SCM_INUM (n));
 }
 #undef FUNC_NAME