make init() and clear_errorstack() more verbose
authorRoker <roker@pep-project.org>
Fri, 19 May 2017 17:42:04 +0200
changeset 1801a04a47881059
parent 1796 51a507ac30e0
child 1802 88931f5dcf75
child 1806 e65e979be062
make init() and clear_errorstack() more verbose
src/pEpEngine.c
     1.1 --- a/src/pEpEngine.c	Thu May 18 12:56:00 2017 +0200
     1.2 +++ b/src/pEpEngine.c	Fri May 19 17:42:04 2017 +0200
     1.3 @@ -240,7 +240,7 @@
     1.4      _session->version = PEP_ENGINE_VERSION;
     1.5  
     1.6  #ifdef DEBUG_ERRORSTACK
     1.7 -    _session->errorstack = new_stringlist(NULL);
     1.8 +    _session->errorstack = new_stringlist("init()");
     1.9  #endif
    1.10  
    1.11      assert(LOCAL_DB);
    1.12 @@ -2336,8 +2336,11 @@
    1.13  
    1.14  DYNAMIC_API void clear_errorstack(PEP_SESSION session)
    1.15  {
    1.16 +    const int old_len = stringlist_length(session->errorstack);
    1.17 +    char buf[48];
    1.18      free_stringlist(session->errorstack);
    1.19 -    session->errorstack = new_stringlist(NULL);
    1.20 +    snprintf(buf, 47, "(%i elements cleared)", old_len);
    1.21 +    session->errorstack = new_stringlist(buf);
    1.22  }
    1.23  
    1.24  #else