~ubuntu-branches/ubuntu/oneiric/firebird2.5/oneiric-security

« back to all changes in this revision

Viewing changes to src/jrd/os/posix/guid.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Damyan Ivanov
  • Date: 2010-07-27 18:12:34 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100727181234-88lvl2nuord9ysx5
Tags: 2.5.0.26054~ReleaseCandidate3.ds2-1
* New upstream release candidate

* update d/copyright to reflect changes in upstream sources
* drop patches applied/implemented upstream
  + refresh the rest to apply cleanly
* Standards-Version: 3.9.1 (no changes necessary)

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
{
72
72
        GenerateRandomBytes(guid, sizeof(FB_GUID));
73
73
}
74
 
 
75
 
void GuidToString(char* buffer, const FB_GUID* guid)
76
 
{
77
 
        sprintf(buffer, "{%04hX%04hX-%04hX-%04hX-%04hX-%04hX%04hX%04hX}",
78
 
                guid->data[0], guid->data[1], guid->data[2], guid->data[3],
79
 
                guid->data[4], guid->data[5], guid->data[6], guid->data[7]);
80
 
}
81
 
 
82
 
void StringToGuid(FB_GUID* guid, const char* buffer)
83
 
{
84
 
        sscanf(buffer, "{%04hX%04hX-%04hX-%04hX-%04hX-%04hX%04hX%04hX}",
85
 
                &guid->data[0], &guid->data[1], &guid->data[2], &guid->data[3],
86
 
                &guid->data[4], &guid->data[5], &guid->data[6], &guid->data[7]);
87
 
}