From cf03f969279cd04993ca17b42cb60eba749e6bb9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Sat, 31 Oct 1998 21:51:54 +0100
Subject: [PATCH] Fixed obscure bug in _exit().

Rev: src/builtin_functions.c:1.136
---
 src/builtin_functions.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/builtin_functions.c b/src/builtin_functions.c
index 3211e394bb..e47ffc4848 100644
--- a/src/builtin_functions.c
+++ b/src/builtin_functions.c
@@ -4,7 +4,7 @@
 ||| See the files COPYING and DISCLAIMER for more information.
 \*/
 #include "global.h"
-RCSID("$Id: builtin_functions.c,v 1.135 1998/10/23 02:14:04 grubba Exp $");
+RCSID("$Id: builtin_functions.c,v 1.136 1998/10/31 20:51:54 grubba Exp $");
 #include "interpret.h"
 #include "svalue.h"
 #include "pike_macros.h"
@@ -778,17 +778,17 @@ void f_string_to_utf8(INT32 args)
 	  len++;
 	  if (c & ~0x1fffff) {
 	    /* 22bit or more. */
-	    if (!extended) {
-	      error("string_to_utf8(): "
-		    "Value 0x%08x (index %d) is larger than 21 bits.\n",
-		    c, i);
-	    }
 	    len++;
 	    if (c & ~0x3ffffff) {
 	      /* 27bit or more. */
 	      len++;
 	      if (c & ~0x7fffffff) {
 		/* 32bit or more. */
+		if (!extended) {
+		  error("string_to_utf8(): "
+			"Value 0x%08x (index %d) is larger than 31 bits.\n",
+			c, i);
+		}
 		len++;
 		/* FIXME: Needs fixing when we get 64bit chars... */
 	      }
@@ -1090,7 +1090,7 @@ void f__exit(INT32 args)
   if(sp[-args].type != T_INT)
     PIKE_ERROR("_exit", "Bad argument 1.\n", sp, args);
 
-  exit(sp[-1].u.integer);
+  exit(sp[-args].u.integer);
 }
 
 void f_time(INT32 args)
-- 
GitLab