[GH-ISSUE #1607] Bugfix in SimpleList #899

Open
opened 2026-02-28 00:05:21 +03:00 by kerem · 1 comment
Owner

Originally created by @Grunzbeck on GitHub (Nov 21, 2022).
Original GitHub issue: https://github.com/SpacehuhnTech/esp8266_deauther/issues/1607

Hello, a simple bugfix:

template
void SimpleList::remove(int index) {
if ((index < 0) || (index >= listSize)) return;

SimpleListNode<T>* nodePrev     = getNode(index - 1);
SimpleListNode<T>* nodeToDelete = getNode(index);

if (index == 0) {
    listBegin = nodeToDelete->next;

    **if (!listBegin) listEnd = NULL;**
} else {
    nodePrev->next = nodeToDelete->next;

    if (!nodePrev->next) listEnd = nodePrev;
}

delete nodeToDelete;

isCached = false;

listSize--;

}

Found by using this useful SimpleList outside the esp8266_deauther project.

Originally created by @Grunzbeck on GitHub (Nov 21, 2022). Original GitHub issue: https://github.com/SpacehuhnTech/esp8266_deauther/issues/1607 Hello, a simple bugfix: template<typename T> void SimpleList<T>::remove(int index) { if ((index < 0) || (index >= listSize)) return; SimpleListNode<T>* nodePrev = getNode(index - 1); SimpleListNode<T>* nodeToDelete = getNode(index); if (index == 0) { listBegin = nodeToDelete->next; **if (!listBegin) listEnd = NULL;** } else { nodePrev->next = nodeToDelete->next; if (!nodePrev->next) listEnd = nodePrev; } delete nodeToDelete; isCached = false; listSize--; } Found by using this useful SimpleList outside the esp8266_deauther project.
Author
Owner

@welcome[bot] commented on GitHub (Nov 21, 2022):

Congrats on opening your first issue on this repository! 🎉
This is a automated message to help you avoid common pitfalls when asking for help online.
👉 Be sure to:
* 🇬🇧 Communicate in English so everybody can understand you
* 📖 Have a look at the Wiki and README for information
* 🔍 Search for similar issues (open and closed)
* ✍️ Provide enough information to understand, recreate and help out with your problem
* ℹ️ Let us know if you find a solution and please share it with us
* 📕 Close the issue when your problem has been solved

<!-- gh-comment-id:1322722164 --> @welcome[bot] commented on GitHub (Nov 21, 2022): Congrats on opening your first issue on this repository! 🎉<br> This is a automated message to help you avoid common pitfalls when asking for help online.<br> 👉 Be sure to:<br> * 🇬🇧 Communicate in English so everybody can understand you<br> * 📖 Have a look at the [Wiki](https://github.com/spacehuhntech/esp8266_deauther/wiki) and [README](https://github.com/SpacehuhnTech/esp8266_deauther/blob/v2/README.md) for information<br> * 🔍 Search for similar [issues (open and closed)](https://github.com/SpacehuhnTech/esp8266_deauther/issues?q=is%3Aissue+)<br> * ✍️ Provide enough information to understand, recreate and help out with your problem<br> * ℹ️ Let us know if you find a solution and please share it with us<br> * 📕 Close the issue when your problem has been solved
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/esp8266_deauther#899
No description provided.