From 469431446ebf3339b9af4aabbf6aa3727b067a46 Mon Sep 17 00:00:00 2001 From: mazzearos Date: Thu, 2 Aug 2012 16:51:38 +0000 Subject: [PATCH] Fix for my previous commit (r1973): Print only the volume name. Limit length to 8 because exceeding the requester border leeds to crashes. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1974 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/help.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/help.c b/src/help.c index 6d022a5a..502b547f 100644 --- a/src/help.c +++ b/src/help.c @@ -815,7 +815,14 @@ void Button_Stats(void) if (mem_size != 0) { #if defined(__AROS__) - sprintf(buffer,"Free space on %s",Main_current_directory); + char *colon = strchr(Main_current_directory, ':'); + int len = strlen(Main_current_directory); + if (colon) + { + len = (long)colon - (long)Main_current_directory; + } + if (len > 8) len = 8; + sprintf(buffer,"Free space on %.*s:",len,Main_current_directory); #else sprintf(buffer,"Free space on %c:",Main_current_directory[0]); #endif