mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
a little bit of thread-safety/re-entrancy safety added
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2327 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -434,11 +434,12 @@ decode_md5_string(const char *string, unsigned char *data)
|
||||
const char *
|
||||
guid_to_string(const GUID * guid)
|
||||
{
|
||||
static char string[33];
|
||||
char *string = malloc(GUID_ENCODING_LENGTH+1);
|
||||
if (!string) return NULL;
|
||||
|
||||
encode_md5_data(guid->data, string);
|
||||
|
||||
string[32] = '\0';
|
||||
string[GUID_ENCODING_LENGTH] = '\0';
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
@@ -70,10 +70,9 @@ void guid_new(GUID *guid);
|
||||
/* Return a null-terminated string encoding of the id. String
|
||||
* encodings of identifiers are hex numbers printed only with the
|
||||
* characters '0' through '9' and 'a' through 'f'. The encoding will
|
||||
* always be 32 characters long. The returned string should not be
|
||||
* modified. A subsequent call to guid_to_string() will overwrite
|
||||
* the result of a previous call. hack alert -- this means that
|
||||
* this routine is *not* thread safe! ... needs fixing. */
|
||||
* always be 32 characters long. The returned string should be
|
||||
* freed when no longer needed.
|
||||
*/
|
||||
const char * guid_to_string(const GUID * guid);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user