summaryrefslogtreecommitdiff
path: root/src/raptor_uri.c
diff options
context:
space:
mode:
authorLauri Aalto <laalto@iki.fi>2007-11-12 08:36:58 +0000
committerLauri Aalto <laalto@iki.fi>2007-11-12 08:36:58 +0000
commit033b6cbbc99be43a1ef348bddc2c07c1afc2c212 (patch)
tree85a925d55ae7ed8f414c8058f555a0002f14c9b0 /src/raptor_uri.c
parentf6cf7fe15793b62b1d666e512e5bc1c4b5483bcc (diff)
downloadraptor-033b6cbbc99be43a1ef348bddc2c07c1afc2c212.tar.gz
(raptor_uri_set_handler) Assert inputs
Diffstat (limited to 'src/raptor_uri.c')
-rw-r--r--src/raptor_uri.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/raptor_uri.c b/src/raptor_uri.c
index b621cde1..591d5f43 100644
--- a/src/raptor_uri.c
+++ b/src/raptor_uri.c
@@ -74,7 +74,12 @@ static void *raptor_uri_current_uri_context;
void
raptor_uri_set_handler(raptor_uri_handler *handler, void *context)
{
- raptor_uri_current_uri_handler=(raptor_uri_handler *)handler;
+ RAPTOR_ASSERT_OBJECT_POINTER_RETURN(handler, raptor_uri_handler);
+ /* RAPTOR_ASSERT is the negative of ordinary asserts - it fails if the condition is true */
+ RAPTOR_ASSERT(!(handler->initialised >= 1 && handler->initialised <= 2),
+ "raptor_uri_handler->initialised not 1..2");
+
+ raptor_uri_current_uri_handler=handler;
raptor_uri_current_uri_context=context;
}