vfs: check userland buffers before reading them.
[haiku.git] / src / system / libroot / add-ons / icu / ICULocaleconvData.cpp
blob13459745ca4f7ebaaa08f2f08e11483042344cfd
1 /*
2 * Copyright 2010-2011, Oliver Tappe, zooey@hirschkaefer.de.
3 * Distributed under the terms of the MIT License.
4 */
7 #include "ICULocaleconvData.h"
9 #include <string.h>
12 namespace BPrivate {
13 namespace Libroot {
16 ICULocaleconvData::ICULocaleconvData(pthread_key_t tlsKey)
17 : inherited(tlsKey)
22 status_t
23 ICULocaleconvData::_SetLocaleconvEntry(const DecimalFormatSymbols* formatSymbols,
24 char* destination, FormatSymbol symbol, const char* defaultValue)
26 status_t result = B_OK;
28 UnicodeString symbolString = formatSymbols->getSymbol(symbol);
29 if (!symbolString.isEmpty()) {
30 result = _ConvertUnicodeStringToLocaleconvEntry(symbolString,
31 destination, skLCBufSize, defaultValue);
32 } else
33 destination[0] = '\0';
35 return result;
39 } // namespace Libroot
40 } // namespace BPrivate