From 410eadf2f54d1cf5ecaebcd4b8dfa1eac5005063 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 6 Dec 2012 17:58:36 +0100 Subject: [PATCH] print a warning when calling set_module_property at the wrong time --- src/csync.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/csync.c b/src/csync.c index c0db9ec037..3e1508aa7e 100644 --- a/src/csync.c +++ b/src/csync.c @@ -1009,6 +1009,11 @@ bool csync_file_known( char *statedb_file, const char* url ) { int csync_set_module_property(CSYNC* ctx, const char* key, void* value) { + if (!(ctx->status & CSYNC_STATUS_INIT)) { + ctx->error_code = CSYNC_ERR_UNSPEC; + fprintf(stderr, "This function must be called after initialization."); + return -1; + } return csync_vio_set_property(ctx, key, value); }