On 01/26/2013 01:58 PM, Miguel Ángel wrote:
> Hi Christian.
> 
> I did not join to bug-GNUnet (now I am) so I did not receive the last
> reply message, but I have read it in the archive. Also I haven't
> received the TP confirmation yet, as soon as I get it, I will notify
> here.

Great.

> The string "`%' must be followed by HEX number" can be found at:
> ./gnunet/src/fs/fs_uri.c:220:        *emsg = GNUNET_strdup (_("`%' must
> be followed by HEX number"));
> 

Ok, should be fixed in SVN 25923.

> I have taking a look over the code and it is returned by the local
> function percent_decode_keyword, that it is only used in the local
> function uri_ksk_parse that is used at the function GNUNET_FS_uri_parse.
> Every use of this return value is to a %s in a format string and (like
> probably any other error message) it is not used as the format. There
> may be a memory leak that I could look carefully at fs-api.c
>   if (NULL != uris)
>   {
>     uc->ksk_uri = GNUNET_FS_uri_parse (uris, &emsg);
>     GNUNET_free (uris);
>     if (NULL == uc->ksk_uri)
>     {
>       GNUNET_break (0);
>       goto cleanup;
>     }
>   }
> Because emsg is also used in the cleanup here
> cleanup:
>   GNUNET_free_non_null (uc->filename);
>   if ((NULL != rh) && (GNUNET_OK != GNUNET_BIO_read_close (rh, &emsg)))
> 
> Maybe I am loosing time because that function already frees the memory
> or It is not actually being called, you may know better than me. I saw
> it looking for the emsg printing, but I also could test it.

No, you're right, there is indeed a (minor) leak there.  Fixed in SVN 25924.


> Resuming, that string is not a c-format string. But when gnunet.pot is
> generated by make it contains:
> #: src/fs/fs_uri.c:220
> #, c-format
> msgid "`%' must be followed by HEX number"
> msgstr ""
> 
> That gives always an error when you execute msgfmt except when copying
> the same string. It seems that gettext sees %' format as valid and
> searches it into the msgstr. Here
> (http://www.gnu.org/software/gettext/manual/html_node/c_002dformat-Flag.html) 
> you can find information about that, the solution is to place around a 
> comment with xgettext:no-c-format.
> 
> Happy hacking! :)

Happy hacking indeed ;-).

-Christian

_______________________________________________
Bug-GNUnet mailing list
Bug-GNUnet@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-gnunet

Reply via email to