From 8c4a199c102bf10d9b986e8487ff3a8d3023d21c Mon Sep 17 00:00:00 2001 From: "paulio.eth" Date: Wed, 27 Nov 2024 09:32:15 -0800 Subject: [PATCH] fixed flags --- pnpm-lock.yaml | 22 ++++++++++++++++++++++ src/utils/StringUtils.sol | 9 +++++++++ 2 files changed, 31 insertions(+) create mode 100644 pnpm-lock.yaml diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..efd480a --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,22 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + '@pythnetwork/pyth-sdk-solidity': + specifier: ^4.0.0 + version: 4.0.0 + +packages: + + '@pythnetwork/pyth-sdk-solidity@4.0.0': + resolution: {integrity: sha512-Cy2MvSN1Oh5YpIYmZd2In6/gfXbGjnpazmXKioTuq07Drp4Rl2XHcvtqHdgilplCl32IG4pU+XoRafpexID08A==} + +snapshots: + + '@pythnetwork/pyth-sdk-solidity@4.0.0': {} diff --git a/src/utils/StringUtils.sol b/src/utils/StringUtils.sol index 3364d78..5b10dd7 100644 --- a/src/utils/StringUtils.sol +++ b/src/utils/StringUtils.sol @@ -135,6 +135,15 @@ library StringUtils { } } + // Checks if the character at index is a Tag Indicator (used in special flag sequences) + if ( + b == 0xF3 && index + 2 < strBytes.length && + strBytes[index + 1] == 0xA0 && + strBytes[index + 2] >= 0x80 && strBytes[index + 2] <= 0x9F + ) { + return true; + } + return false; }