[gpgme] change work dir

Marcus Brinkmann marcus.brinkmann at ruhr-uni-bochum.de
Sun Dec 12 19:47:49 CET 2004

At Sun, 12 Dec 2004 18:42:23 +0100,
Franz Scheerer <fscheerer1 at gmx.de> wrote:
> Hi,
> I do not understand the sense behind gpg in general and especially not
> the sense of gpgme. 
> But I just took a glance on that funny code:
> > > -      assert (file_name);
> Obivously file_name is expected not to be empty at that point.

Wrong, as the surrounding code clearly shows.
> > > -      new_file_name = strdup (new_file_name);
> So, strdup does approximately the same as the familiar strcpy, but allocates 
> memory for the destination, too. That makes sense, if no memory is allocated 
> for the destination new_file_name. But, in this case the argument of strdup 
> can not be new_file_name. Most likely one should use file_name (not 
> new_file-name) as argument instead, which is not empty as asserted before.

You are confused about how the code is supposed to work.


More information about the Gnupg-devel mailing list