X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Ffs%2Fgnunet-unindex.c;h=094d8868d5efb821a3a3da545d6263a50987b44f;hb=6973ade884b8e22e7fcaa51a90d00a8caa2d2fa4;hp=f4e35273793af7a21b94afb1e9b9d72ecd23b47f;hpb=7e5c0a94bacdfe6e1c65035b16fd97a77398df12;p=oweals%2Fgnunet.git diff --git a/src/fs/gnunet-unindex.c b/src/fs/gnunet-unindex.c index f4e352737..094d8868d 100644 --- a/src/fs/gnunet-unindex.c +++ b/src/fs/gnunet-unindex.c @@ -76,7 +76,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) static void * progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) { - char *s; + const char *s; switch (info->status) { @@ -85,11 +85,10 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) case GNUNET_FS_STATUS_UNINDEX_PROGRESS: if (verbose) { - s = GNUNET_STRINGS_relative_time_to_string (info->value.unindex.eta); + s = GNUNET_STRINGS_relative_time_to_string (info->value.unindex.eta, GNUNET_YES); FPRINTF (stdout, _("Unindexing at %llu/%llu (%s remaining)\n"), (unsigned long long) info->value.unindex.completed, (unsigned long long) info->value.unindex.size, s); - GNUNET_free (s); } break; case GNUNET_FS_STATUS_UNINDEX_ERROR: @@ -174,11 +173,13 @@ main (int argc, char *const *argv) if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; - return (GNUNET_OK == - GNUNET_PROGRAM_run (argc, argv, "gnunet-unindex [OPTIONS] FILENAME", - gettext_noop - ("Unindex a file that was previously indexed with gnunet-publish."), - options, &run, NULL)) ? ret : 1; + ret = (GNUNET_OK == + GNUNET_PROGRAM_run (argc, argv, "gnunet-unindex [OPTIONS] FILENAME", + gettext_noop + ("Unindex a file that was previously indexed with gnunet-publish."), + options, &run, NULL)) ? ret : 1; + GNUNET_free ((void*) argv); + return ret; } /* end of gnunet-unindex.c */