summaryrefslogtreecommitdiff
path: root/src/pool.cc
diff options
context:
space:
mode:
authorTaylor R Campbell <campbell+ledger@mumble.net>2024-04-27 19:54:23 +0000
committerJohn Wiegley <johnw@newartisans.com>2024-08-06 14:51:38 -1000
commitd9967c2638052730c6eeb1624586d633d6482003 (patch)
treef6dd9d0a94cc633f4e1a4f0588c2cb613e0100e2 /src/pool.cc
parent762353945a744ae4b89970b9e08c2c22a52ddbff (diff)
downloadfork-ledger-d9967c2638052730c6eeb1624586d633d6482003.tar.gz
fork-ledger-d9967c2638052730c6eeb1624586d633d6482003.tar.bz2
fork-ledger-d9967c2638052730c6eeb1624586d633d6482003.zip
Avoid ctype abuse.
fix https://github.com/ledger/ledger/issues/2338 fix https://github.com/ledger/ledger/issues/2340
Diffstat (limited to 'src/pool.cc')
-rw-r--r--src/pool.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pool.cc b/src/pool.cc
index 73e76644..2d2b17cb 100644
--- a/src/pool.cc
+++ b/src/pool.cc
@@ -327,13 +327,15 @@ commodity_pool_t::parse_price_directive
datetime_t datetime;
string symbol;
- if (! no_date && std::isdigit(time_field_ptr[0])) {
+ if (! no_date &&
+ std::isdigit(static_cast<unsigned char>(time_field_ptr[0]))) {
symbol_and_price = next_element(time_field_ptr);
if (! symbol_and_price) return none;
datetime = parse_datetime(date_field + " " + time_field_ptr);
}
- else if (! no_date && std::isdigit(date_field_ptr[0])) {
+ else if (! no_date &&
+ std::isdigit(static_cast<unsigned char>(date_field_ptr[0]))) {
symbol_and_price = time_field_ptr;
datetime = datetime_t(parse_date(date_field));
}