diff options
-rw-r--r-- | .github/workflows/codeql-analysis.yml | 6 | ||||
-rw-r--r-- | NEWS | 6 | ||||
-rw-r--r-- | src/jplist.c | 6 |
3 files changed, 13 insertions, 5 deletions
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 9e02074..8f2384a 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -28,7 +28,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: # We must fetch at least the immediate parents so that if this is # a pull request then we can checkout the head. @@ -36,7 +36,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -50,4 +50,4 @@ jobs: make - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 @@ -1,3 +1,9 @@ +Version 2.6.0 +~~~~~~~~~~~~~ + +- Changes: + * Revert back API change around PLIST_DATA to use char* again + Version 2.5.0 ~~~~~~~~~~~~~ diff --git a/src/jplist.c b/src/jplist.c index 782d2b3..4f30cd0 100644 --- a/src/jplist.c +++ b/src/jplist.c @@ -460,6 +460,8 @@ static int64_t parse_decimal(const char* str, const char* str_end, char** endp) if (str[0] == '-') { is_neg = 1; (*endp)++; + } else if (str[0] == '+') { + (*endp)++; } if (is_neg) { MAX++; @@ -522,7 +524,7 @@ static plist_t parse_primitive(const char* js, jsmntok_info_t* ti, int* index) } else { val = plist_new_uint((uint64_t)intpart); } - } else if ((*endp == '.' && endp+1 < str_end && isdigit(*(endp+1))) || ((*endp == 'e' || *endp == 'E') && endp+1 < str_end && (isdigit(*(endp+1)) || ((*(endp+1) == '-') && endp+2 < str_end && isdigit(*(endp+2)))))) { + } else if ((*endp == '.' && endp+1 < str_end && isdigit(*(endp+1))) || ((*endp == 'e' || *endp == 'E') && endp+1 < str_end && (isdigit(*(endp+1)) || (((*(endp+1) == '-') || (*(endp+1) == '+')) && endp+2 < str_end && isdigit(*(endp+2)))))) { /* floating point */ double dval = (double)intpart; char* fendp = endp; @@ -546,7 +548,7 @@ static plist_t parse_primitive(const char* js, jsmntok_info_t* ti, int* index) if (fendp >= str_end) { break; } - if (fendp+1 < str_end && (*fendp == 'e' || *fendp == 'E') && (isdigit(*(fendp+1)) || ((*(fendp+1) == '-') && fendp+2 < str_end && isdigit(*(fendp+2))))) { + if (fendp+1 < str_end && (*fendp == 'e' || *fendp == 'E') && (isdigit(*(fendp+1)) || (((*(fendp+1) == '-') || (*(fendp+1) == '+')) && fendp+2 < str_end && isdigit(*(fendp+2))))) { int64_t exp = parse_decimal(fendp+1, str_end, &fendp); dval = dval * pow(10, (double)exp); } else { |