rhuij...@apache.org wrote on Thu, Apr 21, 2011 at 15:47:25 -0000: > +int > +main(int argc, const char *argv[]) > +{ > + apr_pool_t *pool; > + int exit_code = EXIT_SUCCESS; > + svn_error_t *err; > + svn_boolean_t recursive; > + > + if (argc < 2 || argc > 3) > + { > + fprintf(stderr, USAGE_MSG, argv[0]); > + exit(1); > + } > +
This allows argc == 2, > + if (apr_initialize() != APR_SUCCESS) > + { > + fprintf(stderr, "apr_initialize() failed.\n"); > + exit(1); > + } > + > + /* set up the global pool */ > + pool = svn_pool_create(NULL); > + > + recursive = (strcmp(argv[1], "-1") != 0); > + > + err = obtain_lock(argv[2], recursive, pool); in which case argv[2] == NULL, > +static svn_error_t * > +obtain_lock(const char *path, svn_boolean_t recursive, > + apr_pool_t *scratch_pool) > +{ > + const char *local_abspath; > + svn_wc_context_t *wc_ctx; > + > + SVN_ERR(svn_path_cstring_to_utf8(&path, path, scratch_pool)); which is then passed to to this function, which ultimately calls strlen() on its second argument. > +} > + In short: did you mean "if (argc != 3)"?