aboutsummaryrefslogtreecommitdiff
path: root/common/md5.cpp
diff options
context:
space:
mode:
authorDavid Corrales2007-05-31 23:44:43 +0000
committerDavid Corrales2007-05-31 23:44:43 +0000
commit0cab5b7791e56b32455748bf20c21f0d6b42f654 (patch)
tree9e6580328542f1db230e019ba77e3db1be8fa50b /common/md5.cpp
parent6c69d531d262e14fa02b6e1adb42baaa5c74dbe6 (diff)
parent22c0403e0dfec16badf156afa842c6c37e850263 (diff)
downloadscummvm-rg350-0cab5b7791e56b32455748bf20c21f0d6b42f654.tar.gz
scummvm-rg350-0cab5b7791e56b32455748bf20c21f0d6b42f654.tar.bz2
scummvm-rg350-0cab5b7791e56b32455748bf20c21f0d6b42f654.zip
Merged the fs branch with trunk. r26949:27031
svn-id: r27032
Diffstat (limited to 'common/md5.cpp')
-rw-r--r--common/md5.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/common/md5.cpp b/common/md5.cpp
index 700897e08f..a48ecb4948 100644
--- a/common/md5.cpp
+++ b/common/md5.cpp
@@ -1,5 +1,8 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2002-2006 The ScummVM project
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -301,37 +304,37 @@ bool md5_file(ReadStream &stream, uint8 digest[16], uint32 length) {
return true;
}
-bool md5_file_string(const FilesystemNode &file, char md5str[32+1], uint32 length) {
+bool md5_file_string(const FilesystemNode &file, char *md5str, uint32 length) {
uint8 digest[16];
if (!md5_file(file, digest, length))
return false;
for (int i = 0; i < 16; i++) {
- sprintf(md5str + i*2, "%02x", (int)digest[i]);
+ snprintf(md5str + i*2, 3, "%02x", (int)digest[i]);
}
return true;
}
-bool md5_file_string(const char *name, char md5str[32+1], uint32 length) {
+bool md5_file_string(const char *name, char *md5str, uint32 length) {
uint8 digest[16];
if (!md5_file(name, digest, length))
return false;
for (int i = 0; i < 16; i++) {
- sprintf(md5str + i*2, "%02x", (int)digest[i]);
+ snprintf(md5str + i*2, 3, "%02x", (int)digest[i]);
}
return true;
}
-bool md5_file_string(ReadStream &stream, char md5str[32+1], uint32 length) {
+bool md5_file_string(ReadStream &stream, char *md5str, uint32 length) {
uint8 digest[16];
if (!md5_file(stream, digest, length))
return false;
for (int i = 0; i < 16; i++) {
- sprintf(md5str + i*2, "%02x", (int)digest[i]);
+ snprintf(md5str + i*2, 3, "%02x", (int)digest[i]);
}
return true;