Merge branch 'master'

This commit is contained in:
Laila van Reenen 2024-04-13 23:53:29 +02:00
commit 3b3761faa9
3 changed files with 11 additions and 5 deletions

View File

@ -78,7 +78,8 @@ char* fifoToString(FIFOBuffChar_t* fifo)
char* out = malloc(fifo->size + 1);
char* write_p = out;
for (int i = fifo->size; i > 0; i--)
int i;
for (i = fifo->size; i > 0; i--)
{
FIFOBuffChar_get(fifo, write_p);
write_p++;
@ -111,6 +112,7 @@ void CLI_PrintHistory()
void historyPrevius()
{
char* line;
int i;
if (
(History_getCurrPos(History) == History_getSize(History))
&& (FIFOBuffChar_getSize(FIFO) > 0)
@ -119,7 +121,7 @@ void historyPrevius()
// add current text to end of history
line = fifoToString(FIFO);
History_put(History, line);
for (int i=0; *(line + i) != '\0'; i++)
for (i=0; *(line + i) != '\0'; i++)
{
CLI_stringOut((char*)"\x1b[D \x1b[D");
}
@ -139,7 +141,7 @@ void historyPrevius()
// write line
if ((ret >= 0) && (line != NULL))
{
for (int i=0; *(line + i) != '\0'; i++)
for (i=0; *(line + i) != '\0'; i++)
{
CLI_charIn(*(line + i));
}
@ -161,7 +163,8 @@ void historyNext()
// write line
if ((ret >= 0) && (line != NULL))
{
for (int i=0; *(line + i) != '\0'; i++)
int i;
for (i=0; *(line + i) != '\0'; i++)
{
CLI_charIn(*(line + i));
}

View File

@ -19,7 +19,8 @@ int CMDList_deinit(CMDList_t *list)
{
CMDList_t** list_p = (CMDList_t**)list;
for (int i = 0; i < 26; i++)
int i;
for (i = 0; i < 26; i++)
{
if (*(list_p + i) != NULL)
{

View File

@ -141,6 +141,7 @@ bool FIFOBuffChar_pop(FIFOBuffChar_t *fifo)
default: // buffer is at least 2 element big
// find the second last element
{
FIFOBuffChar_element_t* secondLastEl = fifo->FirstEl_p;
while (
secondLastEl->nextElement != fifo->LastEl_p
@ -158,6 +159,7 @@ bool FIFOBuffChar_pop(FIFOBuffChar_t *fifo)
fifo->size--;
ok = true;
break;
}
}
return ok;