aboutsummaryrefslogtreecommitdiff
path: root/src/unstable/uuid.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2014-10-03 15:54:36 +0000
committerMike Buland <eichlan@xagasoft.com>2014-10-03 15:54:36 +0000
commit0f26ab693e82d1c56ea0be653a8cd670abeb8f89 (patch)
tree34006fd7690a23a7ec49160398390d6c31e642e8 /src/unstable/uuid.cpp
parentc5f69c22ca51510da1674bf56982f8f1e3ca4a40 (diff)
downloadlibbu++-0f26ab693e82d1c56ea0be653a8cd670abeb8f89.tar.gz
libbu++-0f26ab693e82d1c56ea0be653a8cd670abeb8f89.tar.bz2
libbu++-0f26ab693e82d1c56ea0be653a8cd670abeb8f89.tar.xz
libbu++-0f26ab693e82d1c56ea0be653a8cd670abeb8f89.zip
Tweaked Bu::Uuid loading to pad it's data more cleanly. This will help ensure
that we don't get valgrind errors, and is probably safer in general. Added Bu::ArchiveStream. It could use some tweaks, but as a quick hack it's handy to allow systems that can only read/write from/to streams to work with archives.
Diffstat (limited to 'src/unstable/uuid.cpp')
-rw-r--r--src/unstable/uuid.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/unstable/uuid.cpp b/src/unstable/uuid.cpp
index db758d0..22517d7 100644
--- a/src/unstable/uuid.cpp
+++ b/src/unstable/uuid.cpp
@@ -104,7 +104,8 @@ Bu::Uuid Bu::Uuid::generate( Bu::Uuid::Type eType )
104 case System: 104 case System:
105#if defined(linux) 105#if defined(linux)
106 Bu::File fIn( "/proc/sys/kernel/random/uuid", Bu::File::Read ); 106 Bu::File fIn( "/proc/sys/kernel/random/uuid", Bu::File::Read );
107 char dat[36]; 107 char dat[37];
108 memset( dat, 0, 37 );
108 fIn.read( dat, 36 ); 109 fIn.read( dat, 36 );
109 id.set( dat ); 110 id.set( dat );
110#elif defined(WIN32) 111#elif defined(WIN32)