From: Werner Koch Date: Mon, 1 Jul 2002 13:09:18 +0000 (+0000) Subject: (xstrdup): Oops, obviously I calculated the length wrong when X-Git-Tag: gpgme-1.2.0@1385~901 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=966b4bfb90058a070df08d7c77994b09c7ed8b84;p=gpgme.git (xstrdup): Oops, obviously I calculated the length wrong when coded this. Tsss, wrote xstrdup some hundreds times but missed it this time. Thanks to Steffen Hansen for noticing it. --- diff --git a/trunk/gpgmeplug/ChangeLog b/trunk/gpgmeplug/ChangeLog index 0572044..ae803c3 100644 --- a/trunk/gpgmeplug/ChangeLog +++ b/trunk/gpgmeplug/ChangeLog @@ -14,6 +14,10 @@ malloc. Removed superfluous string termination. (parseAddress): Use xmalloc instead of an unchecked malloc. (nextAddress): Ditto. + (xstrdup): Oops, obviously I calculated the length wrong when + coded this. Tsss, wrote xstrdup some hundreds times but missed it + this time. Thanks to Steffen Hansen for noticing it. + * gpgmeplug.c: Moved a few helper functions more to the top. Fixed comment syntax. Merged a copyright notice somewhere in the middle of the file with the one at the top. diff --git a/trunk/gpgmeplug/gpgmeplug.c b/trunk/gpgmeplug/gpgmeplug.c index 7a2ea25..0b039a4 100644 --- a/trunk/gpgmeplug/gpgmeplug.c +++ b/trunk/gpgmeplug/gpgmeplug.c @@ -239,7 +239,7 @@ xmalloc (size_t n) static char * xstrdup (const char *string) { - char *p = xmalloc (strlen (string)); + char *p = xmalloc (strlen (string)+1); strcpy (p, string); return p; }