From d82ca9895d83bd0a62f1197cedafb78fe06322b7 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Wed, 24 Sep 2008 15:42:33 +0000 Subject: [PATCH] check for value > 0 before using it as array index Fix for Coverity error CID: 438 svn path=/trunk/; revision=36485 --- reactos/dll/cpl/intl/currency.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reactos/dll/cpl/intl/currency.c b/reactos/dll/cpl/intl/currency.c index b9d9868b247..9e81f6c2ff9 100644 --- a/reactos/dll/cpl/intl/currency.c +++ b/reactos/dll/cpl/intl/currency.c @@ -413,7 +413,8 @@ SetCurrencyDigNum(HWND hwndDlg, LCID lcid) (LPARAM)0); /* Save number of digidts in field */ - SetLocaleInfo(lcid, LOCALE_SMONGROUPING, szFieldDigNumSamples[nCurrSel]); + if (nCurrSel > 0) + SetLocaleInfo(lcid, LOCALE_SMONGROUPING, szFieldDigNumSamples[nCurrSel]); return TRUE; }