2 Commits

Author SHA1 Message Date
4c71625730 [CI] Removing double zip and misleading zip type (#5512)
* Removing double zip and misleading zip type

* Removing extra spaces

---------

Co-authored-by: maiconpintoabreu <maicon@thinkpad02.exads.com>
2026-01-26 12:04:45 +01:00
3568b6e293 [rtext] Fix and enhance TextReplace() function (#5511)
* add check for replacement,replace strcpy,strncpy with memcpy

* add 4 spaces in if statement

* add spaces
2026-01-26 12:04:22 +01:00
6 changed files with 32 additions and 22 deletions

View File

@ -84,8 +84,10 @@ jobs:
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.RELEASE_NAME }}.tar.gz
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
name: ${{ env.RELEASE_NAME }}
path: |
./build/${{ env.RELEASE_NAME }}
!./build/${{ env.RELEASE_NAME }}.tar.gz
- name: Upload Artifact to Release
uses: softprops/action-gh-release@v1

View File

@ -114,8 +114,10 @@ jobs:
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.RELEASE_NAME }}.tar.gz
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
name: ${{ env.RELEASE_NAME }}
path: |
./build/${{ env.RELEASE_NAME }}
!./build/${{ env.RELEASE_NAME }}.tar.gz
- name: Upload Artifact to Release
uses: softprops/action-gh-release@v1

View File

@ -101,8 +101,10 @@ jobs:
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.RELEASE_NAME }}.tar.gz
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
name: ${{ env.RELEASE_NAME }}
path: |
./build/${{ env.RELEASE_NAME }}
!./build/${{ env.RELEASE_NAME }}.tar.gz
- name: Upload Artifact to Release
uses: softprops/action-gh-release@v1

View File

@ -71,8 +71,10 @@ jobs:
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.RELEASE_NAME }}.zip
path: ./build/${{ env.RELEASE_NAME }}.zip
name: ${{ env.RELEASE_NAME }}
path: |
./build/${{ env.RELEASE_NAME }}
!./build/${{ env.RELEASE_NAME }}.zip
- name: Upload Artifact to Release
uses: softprops/action-gh-release@v1

View File

@ -142,8 +142,10 @@ jobs:
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.RELEASE_NAME }}.zip
path: ./build/${{ env.RELEASE_NAME }}.zip
name: ${{ env.RELEASE_NAME }}
path: |
./build/${{ env.RELEASE_NAME }}
!./build/${{ env.RELEASE_NAME }}.zip
- name: Upload Artifact to Release
uses: softprops/action-gh-release@v1

View File

@ -1727,14 +1727,15 @@ char *GetTextBetween(const char *text, const char *begin, const char *end)
// Replace text string
// REQUIRES: strstr(), strncpy()
// TODO: If (replacement == "") remove "search" text
// WARNING: Allocated memory must be manually freed
char *TextReplace(const char *text, const char *search, const char *replacement)
{
char *result = NULL;
if ((text != NULL) && (search != NULL))
{
{
if (replacement == NULL) replacement = "";
char *insertPoint = NULL; // Next insert point
char *temp = NULL; // Temp pointer
int textLen = 0; // Text string length
@ -1767,16 +1768,15 @@ char *TextReplace(const char *text, const char *search, const char *replacement)
{
insertPoint = (char *)strstr(text, search);
lastReplacePos = (int)(insertPoint - text);
// TODO: Review logic to avoid strcpy()
// OK - Those lines work
temp = strncpy(temp, text, lastReplacePos) + lastReplacePos;
temp = strcpy(temp, replacement) + replaceLen;
// WRONG - But not those ones
//temp = strncpy(temp, text, tempLen - 1) + lastReplacePos;
//tempLen -= lastReplacePos;
//temp = strncpy(temp, replacement, tempLen - 1) + replaceLen;
//tempLen -= replaceLen;
memcpy(temp, text, lastReplacePos);
temp += lastReplacePos;
if (replaceLen > 0)
{
memcpy(temp, replacement, replaceLen);
temp += replaceLen;
}
text += lastReplacePos + searchLen; // Move to next "end of replace"
}