Skip to content
This repository was archived by the owner on Mar 5, 2024. It is now read-only.

tinycrypt: Use a do..while loop and remove explicit CC #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
################################################################################

# EDIT HERE:
CC:=gcc
CFLAGS:=-Os -std=c99 -Wall -Wextra -D_ISOC99_SOURCE -MMD -I../lib/include/ -I../lib/source/ -I../tests/include/
vpath %.c ../lib/source/
ENABLE_TESTS=true
Expand All @@ -27,7 +26,6 @@ else
CFLAGS += -DDISABLE_TESTS
endif

export CC
export CFLAGS
export VPATH
export ENABLE_TESTS
Expand Down
7 changes: 3 additions & 4 deletions lib/source/ctr_prng.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,12 @@
*/
static void arrInc(uint8_t arr[], unsigned int len)
{
unsigned int i;
if (0 != arr) {
for (i = len; i > 0U; i--) {
if (++arr[i-1] != 0U) {
do {
if (++arr[len - 1] != 0) {
break;
}
}
} while (len--);
}
}

Expand Down