gpapatest callback assert patch

Bernhard Reiter bernhard@intevation.de
Tue, 23 May 2000 15:40:12 +0200


--+g7M9IMkV8truYOl
Content-Type: multipart/mixed; boundary="pf9I7BMVVzbSWLtt"


--pf9I7BMVVzbSWLtt
Content-Type: text/plain; charset=us-ascii

On SPARC/Solaris:

gpapa 168:./gpapatest version
gpapatest.c:134: failed assertion `localcalldata'
Abort (core dumped)

after applying the attached patch for essential defensive programming.  :)
JFYI
 	Bernhard


--pf9I7BMVVzbSWLtt
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="gpa-0.3.0-gpapatest-callbackassert.diff"
Content-Transfer-Encoding: quoted-printable

--- gpa-0.3.0/gpapa/gpapatest.c	Tue May 23 15:34:51 2000
+++ gpa-0.3.0work/gpapa/gpapatest.c	Tue May 23 15:30:54 2000
@@ -25,6 +25,8 @@
 #include <glib.h>
 #include "gpapa.h"
=20
+#include <assert.h>
+
 #ifdef __MINGW32__
 #include <windows.h>
 #include <ctype.h>
@@ -128,6 +130,9 @@
 void
 callback (GpapaAction action, gpointer actiondata, gpointer localcalldata)
 {
+ =20
+  assert(localcalldata);
+  assert(actiondata);
   fprintf (stderr, "%s: %s\n", (char *) localcalldata, (char *) actiondata=
);
 }				/* callback */
=20

--pf9I7BMVVzbSWLtt--

--+g7M9IMkV8truYOl
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.1 (SunOS)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAjkqijYACgkQh9ag3dpKERZR/ACgtrxorLVOkHUlwoRKGehiG+yW
9GYAn1E4R9HsScXgYN86PBUxBH97Fak8
=Cu0X
-----END PGP SIGNATURE-----

--+g7M9IMkV8truYOl--