X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Ftemplate%2Fgnunet-template.c;h=212d56f6e30c51105c5c016a9b3681af8065508d;hb=26d1b687ca01be01505b69ff48ae5d3e0cd4186e;hp=ad4e66860d627890c28ab67efaf344d2324c926f;hpb=cf184a3abff916a1935fcc9c501060da59d2ef66;p=oweals%2Fgnunet.git diff --git a/src/template/gnunet-template.c b/src/template/gnunet-template.c index ad4e66860..212d56f6e 100644 --- a/src/template/gnunet-template.c +++ b/src/template/gnunet-template.c @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - (C) 2001, 2002, 2004, 2005, 2006, 2007, 2009 Christian Grothoff (and other contributing authors) + Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007, 2009 Christian Grothoff (and other contributing authors) GNUnet is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published @@ -24,8 +24,7 @@ * @author Christian Grothoff */ #include "platform.h" -#include "gnunet_getopt_lib.h" -#include "gnunet_program_lib.h" +#include "gnunet_util_lib.h" /* #include "gnunet_template_service.h" */ /** @@ -42,9 +41,7 @@ static int ret; * @param cfg configuration */ static void -run (void *cls, - char *const *args, - const char *cfgfile, +run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) { /* main code here */ @@ -65,12 +62,15 @@ main (int argc, char *const *argv) /* FIMXE: add options here */ GNUNET_GETOPT_OPTION_END }; - return (GNUNET_OK == - GNUNET_PROGRAM_run (argc, - argv, - "gnunet-template", - gettext_noop ("help text"), - options, &run, NULL)) ? ret : 1; + if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) + return 2; + + ret = (GNUNET_OK == + GNUNET_PROGRAM_run (argc, argv, "gnunet-template", + gettext_noop ("help text"), options, &run, + NULL)) ? ret : 1; + GNUNET_free ((void*) argv); + return ret; } /* end of gnunet-template.c */