aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/lib/string/strinv.c
blob: 071a99de50396aaea32c0dc10105d50ef419c480 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <kernel/lib/string.h>

void strinv(char *str)
{
	size_t s_str = strlen(str);

	int iterations = (int)s_str / 2;
	for (int i = 0; i < iterations; i++) {
		char aux = str[i];
		str[i] = str[(s_str - i) - 1];
		str[(s_str - i) - 1] = aux;
	}
}