From xemacs-m  Mon Jul 21 16:47:17 1997
Received: from altair.xemacs.org (steve@xemacs.miranova.com [206.190.83.19])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id QAA06047
	for <xemacs-beta@xemacs.org>; Mon, 21 Jul 1997 16:47:16 -0500 (CDT)
Received: (from steve@localhost)
	by altair.xemacs.org (8.8.6/8.8.6) id OAA18421;
	Mon, 21 Jul 1997 14:50:51 -0700
Mail-Copies-To: never
To: xemacs-beta@xemacs.org
Subject: Re: Logic flaw in put-database (Hegbloom crash)
References: <m2en8s5hlg.fsf@altair.xemacs.org> <86en8syxa2.fsf@kramer.in.aventail.com>
X-Face: `'%\i;ySOu]g?NlziJSk_$&@]KP`}~PEQPjZ5;nxSaDW_o$4+4%Ab]%Ifw3ZR;7TIT3,O,'
 @2{L;]ox6kc;$_5kU'n**9vFg-]eV~GbxSVCx|(s%uR[],*:^WKmC`B}(;|k9/m]gwt?&`t;^rfCJg
 khHH>pP1W\)xM0U@!FNDD72{3fDP$PkBhx^7Z?-WxH6DbFN:QOnT`llzW}VGdYv;n9lzljQvKTIBhQ
 YuV
X-Attribution: sb
From: SL Baur <steve@xemacs.org>
In-Reply-To: wmperry@aventail.com's message of "21 Jul 1997 13:18:13 -0700"
Mime-Version: 1.0 (generated by tm-edit 7.108)
Content-Type: text/plain; charset=US-ASCII
Date: 21 Jul 1997 14:50:49 -0700
Message-ID: <m2bu3wgjly.fsf@altair.xemacs.org>
Lines: 37
X-Mailer: Gnus v5.4.64/XEmacs 20.3(beta15) - "Berlin"

William M Perry <wmperry@aventail.com> writes:

>   I originally had it calling prin1-to-string and then doing a 'read' on
> whatever you get back from the db backend.  The problem is if you have a
> generic interface like this, will people expect to be able to do a
> (put-database "Abc" (make-face 'blah) db)?

>   I think we should just put some STRINGP checks in there.

(setq db (open-database "/tmp/data.db" 'berkeley-db 'hash "rw+" 0664))
=> #<database /tmp/data.db (berkeley/hash/readwrite) 0xbb7>
(put-database "One" '(a b c d) db)
=> Wrong type argument: stringp, (a b c d)

1997-07-21  SL Baur  <steve@altair.xemacs.org>

	* database.c (Fputdatabase): Complain when `val' is not a string.

Index: src/database.c
===================================================================
RCS file: /usr/local/xemacs/xemacs-20.0/src/database.c,v
retrieving revision 1.6
diff -u -r1.6 database.c
--- database.c	1997/07/13 22:42:32	1.6
+++ database.c	1997/07/21 20:55:29
@@ -652,9 +652,10 @@
   struct database_struct *db;
   int status;
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
-  
+
   CHECK_DATABASE (dbase);
   CHECK_STRING (key);
+  CHECK_STRING (val);
   db = XDATABASE (dbase);
   if (!DATABASE_LIVE_P (db))
     signal_simple_error ("Attempting to access closed database", dbase);

