From 58acd5acb8e237862113b336908d9720860797f2 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Thu, 5 Jul 2007 09:01:54 +0000 Subject: [PATCH] added default clause to the switch statement. This fixes a memory corruption bug in case the caller supplied an invalid value. Now we use B_TRUNCATE_MIDDLE in that case. Found by Andrea Anzani git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21564 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/InterfaceDefs.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/kits/interface/InterfaceDefs.cpp b/src/kits/interface/InterfaceDefs.cpp index 0a6b3fa6a4..a1373a6635 100644 --- a/src/kits/interface/InterfaceDefs.cpp +++ b/src/kits/interface/InterfaceDefs.cpp @@ -1319,6 +1319,7 @@ truncate_string(const char* string, uint32 mode, float width, // TODO: implement, though it was never implemented on R5 // FALL THROUGH (at least do something) case B_TRUNCATE_MIDDLE: + default: truncated = truncate_middle(source, dest, numChars, escapementArray, width, ellipsisWidth, fontSize); break;