Bug #795
- Addressed lack of uuid_unparse_lower on Solaris. Signed-off-by: Paul Beckingham <paul@beckingham.net>
This commit is contained in:
committed by
Paul Beckingham
parent
2bc8dfbfe7
commit
526fa07326
10
src/util.cpp
10
src/util.cpp
@@ -230,12 +230,22 @@ const std::string uuid ()
|
||||
uuid_t id;
|
||||
uuid_generate (id);
|
||||
char buffer[100] = {0};
|
||||
#ifdef SOLARIS
|
||||
uuid_unparse (id, buffer);
|
||||
#else
|
||||
uuid_unparse_lower (id, buffer);
|
||||
#endif
|
||||
|
||||
// Bug found by Steven de Brouwer.
|
||||
buffer[36] = '\0';
|
||||
|
||||
#ifdef SOLARIS
|
||||
std::string data = std::string (buffer);
|
||||
std::transform (data.begin(), data.end(), data.begin(), ::tolower);
|
||||
return data;
|
||||
#else
|
||||
return std::string (buffer);
|
||||
#endif
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user