summaryrefslogtreecommitdiff
path: root/src/newgrf_gui.cpp
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2007-01-13 13:47:57 +0000
committerDarkvater <darkvater@openttd.org>2007-01-13 13:47:57 +0000
commit5ed33e549e322fa6ebca07263c78263ed7514063 (patch)
treec5dd340a09a075d06a70fed0556e127c470cc125 /src/newgrf_gui.cpp
parentf2e5e604fb671a1b86a942ea9bb480c03b5efa9d (diff)
downloadopenttd-5ed33e549e322fa6ebca07263c78263ed7514063.tar.xz
(svn r8093) -Codechange: Add a function to get a string representation of an MD5SUM and use it.
Diffstat (limited to 'src/newgrf_gui.cpp')
-rw-r--r--src/newgrf_gui.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index d5934a433..6884f043f 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -41,9 +41,7 @@ static int parse_intlist(const char *p, int *items, int maxitems)
static void ShowNewGRFInfo(const GRFConfig *c, uint x, uint y, uint w, bool show_params)
{
- char buff[512];
- char *s;
- uint i;
+ char buff[256];
/* Draw filename or not if it is not known (GRF sent over internet) */
if (c->filename != NULL) {
@@ -57,10 +55,7 @@ static void ShowNewGRFInfo(const GRFConfig *c, uint x, uint y, uint w, bool show
y += DrawStringMultiLine(x, y, STR_NEWGRF_GRF_ID, w);
/* Prepare and draw MD5 sum */
- s = buff;
- for (i = 0; i < lengthof(c->md5sum); i++) {
- s += snprintf(s, lastof(buff) - s, "%02X", c->md5sum[i]);
- }
+ md5sumToString(buff, lastof(buff), c->md5sum);
SetDParamStr(0, buff);
y += DrawStringMultiLine(x, y, STR_NEWGRF_MD5SUM, w);