[PR #1377] [CLOSED] fix: add missing return in removeValueCArray #1975

Open
opened 2026-01-29 15:26:58 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/TheAlgorithms/C/pull/1377
Author: @honey-yogurt
Created: 12/23/2023
Status: Closed

Base: masterHead: master


📝 Commits (1)

  • aa034f9 fix: add missing return in removeValueCArray

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 data_structures/array/carray.c (+1 -0)

📄 Description

removeValueCArray lacks a return statement in one of its branches.

int removeValueCArray(CArray *array, int position)
{
    if (position >= 0 && position < array->size)
    {
        if (array->array[position] != 0)
        {
            array->array[position] = 0;
            // here missing.
            return SUCCESS;
        }
        else
            return POSITION_EMPTY;
    }
    return INVALID_POSITION;
}

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/TheAlgorithms/C/pull/1377 **Author:** [@honey-yogurt](https://github.com/honey-yogurt) **Created:** 12/23/2023 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`aa034f9`](https://github.com/TheAlgorithms/C/commit/aa034f9ec5b9bb421b3d490b832d6b6c6a5e3628) fix: add missing return in removeValueCArray ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `data_structures/array/carray.c` (+1 -0) </details> ### 📄 Description #### removeValueCArray lacks a return statement in one of its branches. ``` int removeValueCArray(CArray *array, int position) { if (position >= 0 && position < array->size) { if (array->array[position] != 0) { array->array[position] = 0; // here missing. return SUCCESS; } else return POSITION_EMPTY; } return INVALID_POSITION; } ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 15:26:58 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/C#1975